URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
Subversion Repositories zipcpu
[/] [zipcpu/] [trunk/] [bench/] [asm/] [testdiv.S] - Rev 41
Go to most recent revision | Compare with Previous | Blame | View Log
entry:; Set up a test programMOV test_div_program(PC),uPCMOV top_of_stack(PC),uSP; Run it in user spaceRTU; Check for how the result came back: R0 = 0 means successMOV uR11,R11TST -1,R11HALT.ZBUSYtest_div_program:SUB 1,SP;LDI 1,R11LDI 5,R0LDI 1,R1LDI 5,R2LDI 0,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 2,R11LDI 5,R0LDI 2,R1LDI 2,R2LDI 1,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 3,R11LDI 0xb53d0,R0LDI 0x2d,R1LDI 16496,R2LDI 32,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 4,R11LDI 2031890191,R0LDI 120193795,R1LDI 16,R2LDI 108789471,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 5,R11LDI 203553,R0LDI 142580994,R1LDI 0,R2LDI 203553,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 6,R11LDI 142580994,R0LDI 203553,R1LDI 700,R2LDI 93894,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 7,R11LDI 142580994,R0LDI 2499,R1LDI 57055,R2LDI 549,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 8,R11LDI -142580994,R0LDI 2499,R1LDI -57055,R2LDI -549,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 9,R11LDI 142580994,R0LDI -2499,R1LDI -57055,R2LDI 549,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;LDI 10,R11LDI -142580994,R0LDI -2499,R1LDI 57055,R2LDI -549,R3MOV __HERE__+3(PC),R4STO R4,1(SP)BRA test_divs;CLR R11TRAP 0test_divs:; R0 = Numerator; R1 = Denominator; R2 = Integer result; R3 = Remainder; R11= Test failure IDSUB 1,SPMOV R2,R4MOV R3,R5MOV __HERE__+3(PC),R2STO R2,1(SP)BRA divsCMP R0,R4BNZ test_failureCMP R1,R5BNZ test_failureADD 1,SPRETNtest_failure:TRAP 0NOOPBUSY
Go to most recent revision | Compare with Previous | Blame | View Log
