Permalink
Browse files

tabs to spaces in boa files

  • Loading branch information...
1 parent 657dd87 commit 41e10afb96c3741e7e878230e77d8502fbb06162 @brosner committed Oct 11, 2009
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,39 +1,39 @@
def bcopy():
- push(esi)
- push(edi)
+ push(esi)
+ push(edi)
- esi = [esp + 0x0C] # src
- edi = [esp + 0x10] # dst
- ecx = [esp + 0x14] # cnt
- cld
+ esi = [esp + 0x0C] # src
+ edi = [esp + 0x10] # dst
+ ecx = [esp + 0x14] # cnt
+ cld
- if esi < edi: # check overlap?
- esi += ecx
- if esi >= edi: # if overlapping ...
- edi += ecx
- ypocb # ... copy backwards
- pop(edi)
- pop(esi)
- ret
- esi -= ecx
+ if esi < edi: # check overlap?
+ esi += ecx
+ if esi >= edi: # if overlapping ...
+ edi += ecx
+ ypocb # ... copy backwards
+ pop(edi)
+ pop(esi)
+ ret
+ esi -= ecx
- eax = ecx
- ecx >>= 2 # first copy whole words
- rep
- movsl
+ eax = ecx
+ ecx >>= 2 # first copy whole words
+ rep
+ movsl
- ecx = eax
- ecx &= 3 # and then any remainder
- rep
- movsb
+ ecx = eax
+ ecx &= 3 # and then any remainder
+ rep
+ movsb
- pop(edi)
- pop(esi)
+ pop(edi)
+ pop(esi)
- def ypocb():
- std
- dec(esi)
- dec(edi)
- rep
- movsb
- cld
+ def ypocb():
+ std
+ dec(esi)
+ dec(edi)
+ rep
+ movsb
+ cld
@@ -3,91 +3,91 @@
#===============================================================================
def initirqs():
- """ initialize interrupts """
- db(0x0f,0x01,0x1d) # set up vectors (lidt [idt_desc])
- dd(idt_desc)
- sti # enable interrupts
+ """ initialize interrupts """
+ db(0x0f,0x01,0x1d) # set up vectors (lidt [idt_desc])
+ dd(idt_desc)
+ sti # enable interrupts
#-------------------------------------------------------------------------------
def ign():
- """ ignored processor trap """
- db(0xcf) # (iret)
+ """ ignored processor trap """
+ db(0xcf) # (iret)
def bpt():
- cli; pusha
- """ breakpoint """
- ebx = [esp + 0x24]
- printf("[%x: eax=%x]\n",ebx,eax)
- popa; db(0xcf)
+ cli; pusha
+ """ breakpoint """
+ ebx = [esp + 0x24]
+ printf("[%x: eax=%x]\n",ebx,eax)
+ popa; db(0xcf)
def igf():
- """ ignored processor trap w/ fault code """
- esp += 4
- db(0xcf)
+ """ ignored processor trap w/ fault code """
+ esp += 4
+ db(0xcf)
def gpf():
- cli; pusha
- """ general protection fault"""
+ cli; pusha
+ """ general protection fault"""
- xor(eax,eax)
- esi = [esp + 0x24]
- lodsw
+ xor(eax,eax)
+ esi = [esp + 0x24]
+ lodsw
- if xor(eax,0x80cd) is z: # linux system call: int $0x80
- [esp + 0x24] = esi
- fake_syscall(esp)
- popa
- esp += 4
- db(0xcf)
+ if xor(eax,0x80cd) is z: # linux system call: int $0x80
+ [esp + 0x24] = esi
+ fake_syscall(esp)
+ popa
+ esp += 4
+ db(0xcf)
- eax = [esp + 0x20]
- ebx = [esp + 0x24]
- printf("[GPF:%x fault=%x]\n",ebx,eax)
- dw(0xfeeb)
+ eax = [esp + 0x20]
+ ebx = [esp + 0x24]
+ printf("[GPF:%x fault=%x]\n",ebx,eax)
+ dw(0xfeeb)
#-------------------------------------------------------------------------------
def icoda():
- """ common interrupt exit code """
- # clear the interrupt
- al = 0x20 # EO1
- outb(0x20,al) # PIC1
+ """ common interrupt exit code """
+ # clear the interrupt
+ al = 0x20 # EO1
+ outb(0x20,al) # PIC1
- # restore the state
- esp += 4
- popa
- db(0xcf) # iret
+ # restore the state
+ esp += 4
+ popa
+ db(0xcf) # iret
#-------------------------------------------------------------------------------
def igp():
- """ ignored PIC interrupt """
- cli; pusha
- icoda
+ """ ignored PIC interrupt """
+ cli; pusha
+ icoda
def clk():
- """ clock tick """
- cli; pusha
- clickticker
- [isr_mask] |= 1
- Py_AddPendingCall(python_isr, 0)
- icoda
+ """ clock tick """
+ cli; pusha
+ clickticker
+ [isr_mask] |= 1
+ Py_AddPendingCall(python_isr, 0)
+ icoda
def key():
- """ keyboard """
- cli; pusha
- [isr_mask] |= 2
- Py_AddPendingCall(python_isr, 0)
- icoda
+ """ keyboard """
+ cli; pusha
+ [isr_mask] |= 2
+ Py_AddPendingCall(python_isr, 0)
+ icoda
def isrs_pending():
- """ returns (and resets) the pending isr flag vector """
- cli
- eax = [isr_mask]
- xor(edx,edx)
- [isr_mask] = edx
- sti
+ """ returns (and resets) the pending isr flag vector """
+ cli
+ eax = [isr_mask]
+ xor(edx,edx)
+ [isr_mask] = edx
+ sti
#-------------------------------------------------------------------------------
# due to the split offsets in the Intel interrupt table,
@@ -96,16 +96,16 @@ def isrs_pending():
idt_desc = dw(0x7f); dd(
dd(ign, 0x00108f00, ign, 0x00108f00, ign, 0x00108f00, bpt, 0x00108f00,
- ign, 0x00108f00, ign, 0x00108f00, ign, 0x00108f00, ign, 0x00108f00,
+ ign, 0x00108f00, ign, 0x00108f00, ign, 0x00108f00, ign, 0x00108f00,
- clk, 0x00108f00, key, 0x00108f00, igp, 0x00108f00, igp, 0x00108f00,
- igp, 0x00108f00, gpf, 0x00108f00, igp, 0x00108f00, igp, 0x00108f00))
+ clk, 0x00108f00, key, 0x00108f00, igp, 0x00108f00, igp, 0x00108f00,
+ igp, 0x00108f00, gpf, 0x00108f00, igp, 0x00108f00, igp, 0x00108f00))
#===============================================================================
def clickticker():
- edx = [ticker]
- if test(edx,edx) is nz:
- eax = [edx]
- inc(eax)
- [edx] = eax
+ edx = [ticker]
+ if test(edx,edx) is nz:
+ eax = [edx]
+ inc(eax)
+ [edx] = eax
@@ -1,36 +1,36 @@
def initstack():
- eax = [esp + 4] # stack to build
- edx = [esp + 8] # PyFunction_Get_CODE(f)
- ecx = [esp + 12] # locals/globals
+ eax = [esp + 4] # stack to build
+ edx = [esp + 8] # PyFunction_Get_CODE(f)
+ ecx = [esp + 12] # locals/globals
- # build a call to PyEval_EvalCode(co, d, d) from -1
- eax -= 0x10
- [eax + 0xC] = ecx
- [eax + 0x8] = ecx
- [eax + 0x4] = edx
- [eax + 0x0] = 0xffffffff
+ # build a call to PyEval_EvalCode(co, d, d) from -1
+ eax -= 0x10
+ [eax + 0xC] = ecx
+ [eax + 0x8] = ecx
+ [eax + 0x4] = edx
+ [eax + 0x0] = 0xffffffff
- # now build the return frame:
- # first the EIP, then a blank register set
- eax -= 0x24
- [eax + 0x20] = PyEval_EvalCode
- xor(edx,edx)
- [eax + 0x1C] = edx # eax
- [eax + 0x18] = edx # ecx
- [eax + 0x14] = edx # edx
- [eax + 0x10] = edx # ebx
- [eax + 0x0C] = edx # (esp)
- [eax + 0x08] = edx # ebp
- [eax + 0x04] = edx # esi
- [eax + 0x00] = edx # edi
+ # now build the return frame:
+ # first the EIP, then a blank register set
+ eax -= 0x24
+ [eax + 0x20] = PyEval_EvalCode
+ xor(edx,edx)
+ [eax + 0x1C] = edx # eax
+ [eax + 0x18] = edx # ecx
+ [eax + 0x14] = edx # edx
+ [eax + 0x10] = edx # ebx
+ [eax + 0x0C] = edx # (esp)
+ [eax + 0x08] = edx # ebp
+ [eax + 0x04] = edx # esi
+ [eax + 0x00] = edx # edi
def swapstacks():
- pusha
- eax = [esp + 0x24] # src
- edx = [esp + 0x28] # dst
- ecx = [esp + 0x2C] # arg
+ pusha
+ eax = [esp + 0x24] # src
+ edx = [esp + 0x28] # dst
+ ecx = [esp + 0x2C] # arg
- [eax] = esp; esp = [edx]
+ [eax] = esp; esp = [edx]
- [esp + 0x1C] = ecx # set new eax to arg
- popa
+ [esp + 0x1C] = ecx # set new eax to arg
+ popa
@@ -3,36 +3,36 @@
#===============================================================================
def vgarplane():
- eax = 4
- edx = 0x3CE; outb(dx,al) # VGA_GC_INDEX
- eax = [esp + 4]
- inc(edx); outb(dx,al)
+ eax = 4
+ edx = 0x3CE; outb(dx,al) # VGA_GC_INDEX
+ eax = [esp + 4]
+ inc(edx); outb(dx,al)
def vgawplane():
- eax = 2
- edx = 0x3C4; outb(dx,al) # VGA_SEQ_INDEX
- eax = [esp + 4]
- ebx = "\001\002\004\008"
- xlat
- inc(edx); outb(dx,al)
+ eax = 2
+ edx = 0x3C4; outb(dx,al) # VGA_SEQ_INDEX
+ eax = [esp + 4]
+ ebx = "\001\002\004\008"
+ xlat
+ inc(edx); outb(dx,al)
# I need BuildTuple before this can go in pyvga.py
####################################################
def vgadefaultpalette():
- # edx = 0x3DA; inb(al,dx)
- # eax = 0; edx = 0x3C0; outb(dx,al)
+ # edx = 0x3DA; inb(al,dx)
+ # eax = 0; edx = 0x3C0; outb(dx,al)
- esi = paldata
- xor(ecx,ecx)
- while ecx < 256:
- eax = ecx; edx = 0x3C8; outb(dx,al)
- lodsb; edx = 0x3C9; outb(dx,al)
- lodsb; edx = 0x3C9; outb(dx,al)
- lodsb; edx = 0x3C9; outb(dx,al)
- inc(ecx)
+ esi = paldata
+ xor(ecx,ecx)
+ while ecx < 256:
+ eax = ecx; edx = 0x3C8; outb(dx,al)
+ lodsb; edx = 0x3C9; outb(dx,al)
+ lodsb; edx = 0x3C9; outb(dx,al)
+ lodsb; edx = 0x3C9; outb(dx,al)
+ inc(ecx)
- # edx = 0x3DA; inb(al,dx)
- # eax = 0x20; edx = 0x3C0; outb(dx,al)
+ # edx = 0x3DA; inb(al,dx)
+ # eax = 0x20; edx = 0x3C0; outb(dx,al)
paldata = db(
0, 0, 0,
View
@@ -1,14 +1,14 @@
sokosyms = dd(
- db("splashscreen",0), bootscreen, 0xfa00,
- db("sokoscreen",0), incbin('sokobg.dat'), 0xfa00,
- db("sokotile",0), sokotile, 0x40,
- db("sokogoal",0), sokogoal, 0x40,
- db("stonetile",0), stonetile, 0x40,
- db("stonegoal",0), stonegoal, 0x40,
- db("wall",0), wall, 0x40,
- db("goal",0), goal, 0x40,
- db("floor",0), floor, 0x40,
- 0, 0, 0)
+ db("splashscreen",0), bootscreen, 0xfa00,
+ db("sokoscreen",0), incbin('sokobg.dat'), 0xfa00,
+ db("sokotile",0), sokotile, 0x40,
+ db("sokogoal",0), sokogoal, 0x40,
+ db("stonetile",0), stonetile, 0x40,
+ db("stonegoal",0), stonegoal, 0x40,
+ db("wall",0), wall, 0x40,
+ db("goal",0), goal, 0x40,
+ db("floor",0), floor, 0x40,
+ 0, 0, 0)
sokotile = db(
0, 0, 0, 0, 24, 25, 0, 0,
Oops, something went wrong.

0 comments on commit 41e10af

Please sign in to comment.