summaryrefslogtreecommitdiff
path: root/samples/drawline.s
diff options
context:
space:
mode:
Diffstat (limited to 'samples/drawline.s')
-rw-r--r--samples/drawline.s33
1 files changed, 22 insertions, 11 deletions
diff --git a/samples/drawline.s b/samples/drawline.s
index aebb3bf..18ee1a9 100644
--- a/samples/drawline.s
+++ b/samples/drawline.s
@@ -36,11 +36,13 @@ DrawLinePrim1: PUSH R10
PUSH R12
PUSH R13
PUSH R14
+ PUSH R30
+ MOV R30, 1
SUB R13, R9, R7
- SHL R13, R13, 1
+ SHL R13, R30
SUB R12, R8, R6
SUB R14, R12, R13
- SHL R12, R12, 1
+ SHL R12, R30
MOV R10, R6
MOV R11, R7
DrawLinePrim1B: JNLE R10, R8, DrawLinePrim1O
@@ -54,7 +56,8 @@ DrawLinePrim1B: JNLE R10, R8, DrawLinePrim1O
DrawLinePrim1C: SUB R14, R12
DrawLinePrim1L: ADD R10, 1
JMP DrawLinePrim1B
-DrawLinePrim1O: POP R14
+DrawLinePrim1O: POP R30
+ POP R14
POP R13
POP R12
POP R11
@@ -90,11 +93,13 @@ DrawLinePrim2: PUSH R10
PUSH R12
PUSH R13
PUSH R14
+ PUSH R30
+ MOV R30, 1
SUB R12, R8, R6
- SHL R12, R12, 1
+ SHL R12, R30
SUB R13, R9, R7
SUB R14, R13, R12
- SHL R13, R13, 1
+ SHL R13, R30
MOV R10, R6
MOV R11, R7
DrawLinePrim2B: JNLE R11, R9, DrawLinePrim2O
@@ -108,7 +113,8 @@ DrawLinePrim2B: JNLE R11, R9, DrawLinePrim2O
DrawLinePrim2C: SUB R14, R13
DrawLinePrim2L: ADD R11, 1
JMP DrawLinePrim2B
-DrawLinePrim2O: POP R14
+DrawLinePrim2O: POP R30
+ POP R14
POP R13
POP R12
POP R11
@@ -144,11 +150,13 @@ DrawLinePrim3: PUSH R10
PUSH R12
PUSH R13
PUSH R14
+ PUSH R30
+ MOV R30, 1
SUB R12, R6, R8
- SHL R12, R12, 1
+ SHL R12, R30
SUB R13, R9, R7
SUB R14, R13, R12
- SHL R13, R13, 1
+ SHL R13, R30
MOV R10, R6
MOV R11, R7
DrawLinePrim3B: JNLE R11, R9, DrawLinePrim3O
@@ -162,7 +170,8 @@ DrawLinePrim3B: JNLE R11, R9, DrawLinePrim3O
DrawLinePrim3C: SUB R14, R13
DrawLinePrim3L: ADD R11, 1
JMP DrawLinePrim3B
-DrawLinePrim3O: POP R14
+DrawLinePrim3O: POP R30
+ POP R14
POP R13
POP R12
POP R11
@@ -198,11 +207,13 @@ DrawLinePrim4: PUSH R10
PUSH R12
PUSH R13
PUSH R14
+ PUSH R30
+ MOV R30, 1
SUB R13, R9, R7
- SHL R13, R13, 1
+ SHL R13, R30
SUB R12, R6, R8
SUB R14, R12, R13
- SHL R12, R12, 1
+ SHL R12, R30
MOV R10, R6
MOV R11, R7
DrawLinePrim4B: JNGE R10, R8, DrawLinePrim4O