chiark / gitweb /
split syncwrite into syncwrite and syncwritehex
authorian <ian>
Mon, 26 Dec 2005 22:32:47 +0000 (22:32 +0000)
committerian <ian>
Mon, 26 Dec 2005 22:32:47 +0000 (22:32 +0000)
detpic/.cvsignore
iwjpictest/Makefile
iwjpictest/syncwrite.asm
iwjpictest/syncwritehex.asm [new file with mode: 0644]

index d3c835c93a505c38f90ffb854b87317660a9fc26..5730ae99657f716aac1e9de02ee16b05b9487434 100644 (file)
@@ -13,6 +13,7 @@ idlocs*.asm
 morse+auto.inc
 ours+pindata.asm
 syncwrite.asm
+syncwritehex.asm
 t.*
 t
 *.new
index 8fb14ae4f2795cc4e99b3fab4fed6adaa49f3169..0132e15bf77c31696c49983d158d3e7c895e2eac 100644 (file)
@@ -26,7 +26,7 @@ include ../pic.make
 %.hex:         %.o $(LIBS) $(DEFLIBS)
                $(LINK)
 
-harness.hex:   harness.o syncwrite.o $(LIBS)
+harness.hex:   harness.o syncwrite.o syncwritehex.o $(LIBS)
                $(LINK)
 
 clean:         pic-clean
index c921b2c329a8f9564bf6edd9f74a0e976391fcbd..582673cf6e6cd2f8a07d3c4a40bfdb90adc3a676 100644 (file)
@@ -1,17 +1,10 @@
 ;======================================================================
-;
-; these routines all use serial_write_char which writes
-; bytes to the serial port synchronously
 
        include         /usr/share/gputils/header/p18f458.inc
        radix           dec
        include         ../iwjpictest/insn-aliases.inc
 
- udata_acs
-serial_hex_temp res 1
-
  code
-
 ;----------------------------------------
 serial_write_char
 ; W            character       undefined
@@ -21,39 +14,6 @@ serial_write_char_loop
        mov_wf          TXREG
        return
 
-;----------------------------------------
-serial_write_hex
-;      transmits W in hex through serial port, using serial_write_char
-;                      Before          After
-; W                    value           undefined
-; serial_hex_temp      undefined       undefined
-       mov_wf          serial_hex_temp
-       rcall           serial_write_hex_1digit_for_both
-       rcall           serial_write_hex_1digit_for_both
-       return
-
-;--------------------
-serial_write_hex_1digit_for_both
-;      transmits top nybble of serial_hex_temp in hex
-;      through serial port, as above, and swaps nybbles
-;              Before          After
-; W                    any             undefined
-; serial_hex_temp      BBBBaaaa        aaaaBBBB        (BBBB was sent)
-       swap_f  serial_hex_temp
-       mov_fw  serial_hex_temp
-;...
-;--------------------
-serial_write_hex_digit
-;      transmits bottom nybble of W in hex
-; W            ????VVVV        undefined
-       and_lw  0x0f
-       sub_lw  10
-       sub_lw  0
-       bra_n   serial_write_hex_digit_ifnot_ge10
-       add_lw  'a'-('0'+10)
-serial_write_hex_digit_ifnot_ge10
-       add_lw  '0'+10
-       bra     serial_write_char
-
+;======================================================================
  include ../iwjpictest/syncwrite.inc
  end
diff --git a/iwjpictest/syncwritehex.asm b/iwjpictest/syncwritehex.asm
new file mode 100644 (file)
index 0000000..4850bbc
--- /dev/null
@@ -0,0 +1,51 @@
+;======================================================================
+;
+; these routines all use serial_write_char which writes
+; bytes to the serial port synchronously
+
+       radix           dec
+       include         ../iwjpictest/insn-aliases.inc
+
+       udata_acs
+serial_hex_temp res 1
+
+ code
+;----------------------------------------------------------------------
+
+;----------------------------------------
+serial_write_hex
+;      transmits W in hex through serial port, using serial_write_char
+;                      Before          After
+; W                    value           undefined
+; serial_hex_temp      undefined       undefined
+       mov_wf          serial_hex_temp
+       rcall           serial_write_hex_1digit_for_both
+       rcall           serial_write_hex_1digit_for_both
+       return
+
+;--------------------
+serial_write_hex_1digit_for_both
+;      transmits top nybble of serial_hex_temp in hex
+;      through serial port, as above, and swaps nybbles
+;              Before          After
+; W                    any             undefined
+; serial_hex_temp      BBBBaaaa        aaaaBBBB        (BBBB was sent)
+       swap_f  serial_hex_temp
+       mov_fw  serial_hex_temp
+;...
+;--------------------
+serial_write_hex_digit
+;      transmits bottom nybble of W in hex
+; W            ????VVVV        undefined
+       and_lw  0x0f
+       sub_lw  10
+       sub_lw  0
+       bra_n   serial_write_hex_digit_ifnot_ge10
+       add_lw  'a'-('0'+10)
+serial_write_hex_digit_ifnot_ge10
+       add_lw  '0'+10
+       bra     serial_write_char
+
+;======================================================================
+ include ../iwjpictest/syncwrite.inc
+ end