X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=assembler%2Ftest.asm;h=cea8724e682606a6b46971ffe21a01007df8a3d3;hb=1907804cab2799ae52ee09adffb64ec37fef7372;hp=ecbc2732179a202efa7e275bf3924d038d261333;hpb=3bd4f014e1ae2af49b2cbdd94a86c07559aacbce;p=b43-tools.git diff --git a/assembler/test.asm b/assembler/test.asm index ecbc273..cea8724 100644 --- a/assembler/test.asm +++ b/assembler/test.asm @@ -1,14 +1,13 @@ /* This is a bcm43xx microcode assembly example. - * - * In this example file, r0 and r1 are always input - * registers and r2 is output. - * For input we can always have constant values or (one) memory - * operand instead of the input registers shown here. * * Registers: - * GPRs: r0 - r63 + * GPRs: r0 - r63 (General Purpose Register) * Offset Registers: off0 - off5 - * SPRs: spr000 + * SPRs: spr000 (Special Purpose Register) + * + * SPRs map to the driver-side IHR registers. + * An SPR offset is converted to an IHR offset by the following + * calculation: IHR = (SPR + 0x400) * 2 * * To access memory, two methods can be used. Examples follow. * Direct linear: @@ -35,7 +34,14 @@ .text + /* Inline assertion inside of a complex immediate. + * The %assert() expression will always return zero. */ + mov (1 + (%assert(1 == ((1 + 2) - 2)))), r0 + label: + /* MUL instruction */ + mul r0,r1,r2 /* mul, r2 := msb, spr6d := lsb */ + /* ADD instructions */ add r0,r1,r2 /* add */ add. r0,r1,r2 /* add, set carry */ @@ -86,6 +92,10 @@ testlabel: jge r0,r1,label /* jump if greater or equal */ jg r0,r1,label /* jump if greater */ jle r0,r1,label /* jump if less or equal */ + jdn r0,r1,label /* jump if difference is negative */ + jdpz r0,r1,label /* jump if difference is non negative */ + jdp r0,r1,label /* jump if difference is positive */ + jdnz r0,r1,label /* jump if difference is non positive */ jzx 7,8,r0,r1,label /* Jump if zero after shift and mask */ jnzx 7,8,r0,r1,label /* Jump if nonzero after shift and mask */ @@ -190,6 +200,7 @@ function_b: radio 0x1234, 0xABC /* Write 0x1234 to RADIO register 0xABC */ shm16 0x1234, 0x0001, 0x0002 /* Write 0x1234 to SHM routing 0x0001, register 0x0002 */ shm32 0x12345678, 0x0001, 0x0002 /* Write 0x12345678 to SHM routing 0x0001, register 0x0002 */ + tram 0x12345678, 0x1234 /* Write 0x12345678 to Template Ram offset 0x1234 */ // vim: syntax=b43 ts=8