added more instructuioins
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,25 +1,104 @@
|
||||
:: variables
|
||||
NVAR var1, 12
|
||||
NVAR var2, 10
|
||||
NVAR outcome, 0
|
||||
JMP 8
|
||||
:: Some insight on this
|
||||
:: @meta is the metadata discriptor
|
||||
::
|
||||
@meta
|
||||
:: Set to codepage 610
|
||||
SEA 610
|
||||
:: codepage always gets stored at byte 0 of mem
|
||||
STA 0
|
||||
:: set interupt 0 to 615 (startup)
|
||||
SEA 615
|
||||
:: store in mem
|
||||
STA 1
|
||||
JMP ready
|
||||
|
||||
@readyjumpback
|
||||
LDA 24
|
||||
JMP ACC
|
||||
|
||||
:: setup
|
||||
SEA var1
|
||||
@ready
|
||||
SEA ready
|
||||
LDX
|
||||
SEA var2
|
||||
SEA 8
|
||||
LDY
|
||||
ADD
|
||||
SVAR outcome, ACC
|
||||
SEA outcome
|
||||
STA 4
|
||||
PRM 4
|
||||
JMP 21
|
||||
STA 24
|
||||
JMP RegisterModes
|
||||
JMP parse
|
||||
|
||||
@RegisterModes
|
||||
NVAR m_add, 068
|
||||
NVAR m_sub, 078
|
||||
NVAR m_div, 088
|
||||
NVAR m_mul, 098
|
||||
NVAR mode, m_mul
|
||||
NVAR A, 10
|
||||
NVAR B, 10
|
||||
JMP readyjumpback
|
||||
|
||||
:: end
|
||||
RVAR var1
|
||||
RVAR var2
|
||||
RVAR outcome
|
||||
@madd
|
||||
SEA A
|
||||
LDX
|
||||
SEA B
|
||||
LDY
|
||||
ADD
|
||||
STA 8
|
||||
JMP EOF
|
||||
|
||||
@msub
|
||||
SEA A
|
||||
LDX
|
||||
SEA B
|
||||
LDY
|
||||
SUB
|
||||
STA 8
|
||||
JMP EOF
|
||||
|
||||
@mmul
|
||||
SEA A
|
||||
LDX
|
||||
SEA B
|
||||
LDY
|
||||
MUL
|
||||
STA 8
|
||||
JMP EOF
|
||||
|
||||
@mdiv
|
||||
SEA A
|
||||
LDX
|
||||
SEA B
|
||||
LDY
|
||||
DIV
|
||||
STA 8
|
||||
JMP EOF
|
||||
|
||||
@parse
|
||||
SEA mode
|
||||
LDX
|
||||
SEA m_add
|
||||
LDY
|
||||
GIE
|
||||
JIE madd
|
||||
SEA mode
|
||||
LDX
|
||||
SEA m_sub
|
||||
LDY
|
||||
GIE
|
||||
JIE msub
|
||||
SEA mode
|
||||
LDX
|
||||
SEA m_mul
|
||||
LDY
|
||||
GIE
|
||||
JIE mmul
|
||||
SEA mode
|
||||
LDX
|
||||
SEA m_div
|
||||
LDY
|
||||
GIE
|
||||
JIE mdiv
|
||||
JMP EOF
|
||||
|
||||
@EOF
|
||||
PRM 8
|
||||
HLT
|
||||
@@ -1,25 +1,104 @@
|
||||
[0] :: variables
|
||||
[1] NVAR var1, 12 :: Create 'var1' with value of '12'
|
||||
[2] NVAR var2, 10 :: Create 'var2' with value of '10'
|
||||
[3] NVAR outcome, 0 :: Create 'outcome' with value of '0'
|
||||
[4] JMP 8 :: Jump to line 8
|
||||
[5]
|
||||
[6]
|
||||
[7] :: setup
|
||||
[8] SEA var1 :: Set Accumulator to 'var1' (12)
|
||||
[9] LDX :: Load Accumulator (12) into X
|
||||
[10] SEA var2 :: Set Accumulator to 'var2' (10)
|
||||
[11] LDY :: Load Accumulator (10) into Y
|
||||
[12] ADD :: Add X (12) and Y (10) and store into the Accumulator (22)
|
||||
[13] SVAR outcome, ACC :: Set variable 'outcome' to '0'
|
||||
[14] SEA outcome :: Set Accumulator to 'outcome' (0)
|
||||
[15] STA 4 :: Store the Accumulator (0) into Memory address 4
|
||||
[16] PRM 4 :: Print value of memory address 4
|
||||
[17] JMP 21 :: Jump to line 21
|
||||
[18]
|
||||
[19]
|
||||
[20] :: end
|
||||
[21] RVAR var1 :: Remove variable 'var1'
|
||||
[22] RVAR var2 :: Remove variable 'var2'
|
||||
[23] RVAR outcome :: Remove variable 'outcome'
|
||||
[24] HLT :: Halt execution
|
||||
[0] :: Some insight on this
|
||||
[1] :: @meta is the metadata discriptor
|
||||
[2] ::
|
||||
[3] @meta :: Unknown command
|
||||
[4] :: Set to codepage 610
|
||||
[5] SEA 610 :: Set Accumulator to 610
|
||||
[6] :: codepage always gets stored at byte 0 of mem
|
||||
[7] STA 0 :: Store the Accumulator (610) into Memory address 0
|
||||
[8] :: set interupt 0 to 615 (startup)
|
||||
[9] SEA 615 :: Set Accumulator to 615
|
||||
[10] :: store in mem
|
||||
[11] STA 1 :: Store the Accumulator (615) into Memory address 1
|
||||
[12] JMP ready :: Jump to line ready
|
||||
[13]
|
||||
[14] @readyjumpback :: Unknown command
|
||||
[15] LDA 24 :: Load memory address 24 into Accumulator
|
||||
[16] JMP ACC :: Jump to line ACC
|
||||
[17]
|
||||
[18] @ready :: Unknown command
|
||||
[19] SEA ready :: Set Accumulator to 0
|
||||
[20] LDX :: Load Accumulator (0) into X
|
||||
[21] SEA 8 :: Set Accumulator to 8
|
||||
[22] LDY :: Load Accumulator (8) into Y
|
||||
[23] ADD :: Add X (0) and Y (8) and store into the Accumulator (8)
|
||||
[24] STA 24 :: Store the Accumulator (8) into Memory address 24
|
||||
[25] JMP RegisterModes :: Jump to line RegisterModes
|
||||
[26] JMP parse :: Jump to line parse
|
||||
[27]
|
||||
[28] @RegisterModes :: Unknown command
|
||||
[29] NVAR m_add, 068 :: Create 'm_add' with value of '68'
|
||||
[30] NVAR m_sub, 078 :: Create 'm_sub' with value of '78'
|
||||
[31] NVAR m_div, 088 :: Create 'm_div' with value of '88'
|
||||
[32] NVAR m_mul, 098 :: Create 'm_mul' with value of '98'
|
||||
[33] NVAR mode, m_mul :: Create 'mode' with value of '98'
|
||||
[34] NVAR A, 10 :: Create 'A' with value of '10'
|
||||
[35] NVAR B, 10 :: Create 'B' with value of '10'
|
||||
[36] JMP readyjumpback :: Jump to line readyjumpback
|
||||
[37]
|
||||
[38] @madd :: Unknown command
|
||||
[39] SEA A :: Set Accumulator to 'A' (10)
|
||||
[40] LDX :: Load Accumulator (10) into X
|
||||
[41] SEA B :: Set Accumulator to 'B' (10)
|
||||
[42] LDY :: Load Accumulator (10) into Y
|
||||
[43] ADD :: Add X (10) and Y (10) and store into the Accumulator (20)
|
||||
[44] STA 8 :: Store the Accumulator (20) into Memory address 8
|
||||
[45] JMP EOF :: Jump to line EOF
|
||||
[46]
|
||||
[47] @msub :: Unknown command
|
||||
[48] SEA A :: Set Accumulator to 'A' (10)
|
||||
[49] LDX :: Load Accumulator (10) into X
|
||||
[50] SEA B :: Set Accumulator to 'B' (10)
|
||||
[51] LDY :: Load Accumulator (10) into Y
|
||||
[52] SUB :: Subtract Y (10) from X (10) and store into the Accumulator (0)
|
||||
[53] STA 8 :: Store the Accumulator (0) into Memory address 8
|
||||
[54] JMP EOF :: Jump to line EOF
|
||||
[55]
|
||||
[56] @mmul :: Unknown command
|
||||
[57] SEA A :: Set Accumulator to 'A' (10)
|
||||
[58] LDX :: Load Accumulator (10) into X
|
||||
[59] SEA B :: Set Accumulator to 'B' (10)
|
||||
[60] LDY :: Load Accumulator (10) into Y
|
||||
[61] MUL :: Multiply X (10) and Y (10) and store into the Accumulator (100)
|
||||
[62] STA 8 :: Store the Accumulator (100) into Memory address 8
|
||||
[63] JMP EOF :: Jump to line EOF
|
||||
[64]
|
||||
[65] @mdiv :: Unknown command
|
||||
[66] SEA A :: Set Accumulator to 'A' (10)
|
||||
[67] LDX :: Load Accumulator (10) into X
|
||||
[68] SEA B :: Set Accumulator to 'B' (10)
|
||||
[69] LDY :: Load Accumulator (10) into Y
|
||||
[70] DIV :: Divide X (10) by Y (10) and store into the Accumulator (1)
|
||||
[71] STA 8 :: Store the Accumulator (1) into Memory address 8
|
||||
[72] JMP EOF :: Jump to line EOF
|
||||
[73]
|
||||
[74] @parse :: Unknown command
|
||||
[75] SEA mode :: Set Accumulator to 'mode' (98)
|
||||
[76] LDX :: Load Accumulator (98) into X
|
||||
[77] SEA m_add :: Set Accumulator to 'm_add' (68)
|
||||
[78] LDY :: Load Accumulator (68) into Y
|
||||
[79] GIE :: Get if X (98) is equal to Y (68)
|
||||
[80] JIE madd :: Unknown command
|
||||
[81] SEA mode :: Set Accumulator to 'mode' (98)
|
||||
[82] LDX :: Load Accumulator (98) into X
|
||||
[83] SEA m_sub :: Set Accumulator to 'm_sub' (78)
|
||||
[84] LDY :: Load Accumulator (78) into Y
|
||||
[85] GIE :: Get if X (98) is equal to Y (78)
|
||||
[86] JIE msub :: Unknown command
|
||||
[87] SEA mode :: Set Accumulator to 'mode' (98)
|
||||
[88] LDX :: Load Accumulator (98) into X
|
||||
[89] SEA m_mul :: Set Accumulator to 'm_mul' (98)
|
||||
[90] LDY :: Load Accumulator (98) into Y
|
||||
[91] GIE :: Get if X (98) is equal to Y (98)
|
||||
[92] JIE mmul :: Unknown command
|
||||
[93] SEA mode :: Set Accumulator to 'mode' (98)
|
||||
[94] LDX :: Load Accumulator (98) into X
|
||||
[95] SEA m_div :: Set Accumulator to 'm_div' (88)
|
||||
[96] LDY :: Load Accumulator (88) into Y
|
||||
[97] GIE :: Get if X (98) is equal to Y (88)
|
||||
[98] JIE mdiv :: Unknown command
|
||||
[99] JMP EOF :: Jump to line EOF
|
||||
[100]
|
||||
[101] @EOF :: Unknown command
|
||||
[102] PRM 8 :: Print value of memory address 8
|
||||
[103] HLT :: Halt execution
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
:: variables
|
||||
NVAR
|
||||
NVAR m_add, 1
|
||||
NVAR m_sub, 2
|
||||
NVAR m_mul, 3
|
||||
NVAR m_div, 4
|
||||
NVAR mode, m_add
|
||||
SEA mode
|
||||
STA 0
|
||||
PRM 0
|
||||
HLT
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user