Script started on Sat Mar 19 16:50:08 2022 bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ cat crt0.s .text .global r0 .global r1 .global r2 .global r3 .global r4 .global r5 .global r6 .global r7 .global r8 .global r9 .global r10 .global r11 .global r12 .global r13 .global r14 .global lr .global sp r0 mov sp, ptra r1 nop r2 nop r3 nop r4 nop r5 nop r6 nop r7 nop r8 nop __bss_clear r9 wrbyte r14,r13 r10 add r13,#1 r11 djnz lr,#__bss_clear r12 jmp #_start r13 .long __bss_start r14 .long 0 '' this must remain zero lr .long __bss_end sp .long 0 __C_LOCK_PTR .long __C_LOCK _start jmp #main 'calld lr, #main jmp #__exit bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ cat test.s .set txpin, 62 .set baud, 115200 .set clkrate, 148500000 .set _p2bitcycles, clkrate/baud .text .global main .global __exit main hubset #$f0 ' set rcfast hubset initval waitx ##250000 ' wait 10ms hubset clkval call #init_uart ' setup a smart pin mov r1, #0 loop altgb r1, #msg ' read a char from the message getbyte r0 tjz r0, #done ' continue until NUL char found add r1, #1 call #tx ' send a char to the uart jmp #loop ' repeat done waitx ##100000 ' let uart finish outputting its data mov r1, #3 leds drvh #39 ' flash the LEDs when we exit drvl #38 waitx ##clkrate drvh #38 drvl #39 waitx ##clkrate djnz r1, #leds 'jmp lr ' return __exit cogid r0 cogstop r0 init_uart flth #txpin wrpin #%01_11110_0, #txpin 'set smartpin async tx serial mov r0, ##_p2bitcycles shl r0, #16 or r0, #7 ' 8 data bits wxpin r0, #txpin _ret_ drvh #txpin tx rqpin inb, #txpin wc 'transmitting? (C high == yes) Needed to initiate tx"); testp #txpin wz 'buffer free? (IN high == yes)"); if_nc_or_z wypin r0, #txpin 'write new byte to Y buffer"); if_c_and_nz jmp #tx ret clkval .long %1_100111_0100101000_1111_10_11 initval .long %1_100111_0100101000_1111_10_00 msg .asciz "Hello World!\r\n" bash-3.2$ bash-3.2$ ../as-new --p2 crt0.s -o crt0.o bash-3.2$ ../as-new --p2 test.s -o test.o bash-3.2$ ../../ld/ld-new crt0.o test.o bash-3.2$ ../../binutils/objcopy -O binary -j .text a.out a.binary bash-3.2$ bash-3.2$ bash-3.2$ loadp2 -t a.binary ( Entering terminal mode. Press Ctrl-] or Ctrl-Z to exit. ) Hello World! bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ ../../binutils/objdump -d a.out a.out: file format elf32-propeller Disassembly of section .text: 00000000 : 0: f60021f8 mov $10, ptra 00000004 : 4: 00000000 nop 00000008 : 8: 00000000 nop 0000000c : c: 00000000 nop 00000010 : 10: 00000000 nop 00000014 : 14: 00000000 nop 00000018 : 18: 00000000 nop 0000001c : 1c: 00000000 nop 00000020 : 20: 00000000 nop 00000024 : 24: fc401c0d wrbyte r14, r13 00000028 : 28: f1041a01 add r13, #1 0000002c : 2c: fb6c1ffd djnz r15, #7f4 <_p2bitcycles+0x2eb> 00000030 : 30: fd900014 jmp #44 <__C_LOCK_PTR> 00000034 : 34: 00000043 _ret_ ror r0, $43 00000038 : 38: 00000000 nop 0000003c : 3c: 00000043 _ret_ ror r0, $43 00000040 : 40: 00000000 nop 00000044 <__C_LOCK_PTR>: 44: 00000042 _ret_ ror r0, $42 00000048 <_start>: 48: fd900004 jmp #4c <_start+0x4> 4c: fd900064 jmp #b0 00000050
: 50: fd65e000 hubset #$f0 54: fd607a00 hubset $3d 58: ff8001e8 augd #$3d000>>9 5c: fd65201f waitx #$90 60: fd607800 hubset $3c 64: fdb00054 call #b8 <__exit+0x4> 68: f6040200 mov r1, #0 0000006c : 6c: f96c023e altgb r1, #62 70: f8e00000 getbyte r0 74: fb940003 tjz r0, #c 78: f1040201 add r1, #1 7c: fdb0005c call #d8 80: fd9fffe8 jmp #68 00000084 : 84: ff8000c3 augd #$18600>>9 88: fd65401f waitx #$a0 8c: f6040203 mov r1, #3 00000090 : 90: fd644e59 drvh #$27 94: fd644c58 drvl #$26 98: ff846cf7 augd #$8d9ee00>>9 9c: fd64401f waitx #$20 a0: fd644c59 drvh #$26 a4: fd644e58 drvl #$27 a8: ff846cf7 augd #$8d9ee00>>9 ac: fd64401f waitx #$20 b0: fb6c03f7 djnz r1, #7dc <_p2bitcycles+0x2d3> 000000b4 <__exit>: b4: fd600001 cogid r0 b8: fd600003 cogstop r0 000000bc : bc: fd647c51 flth #$3e c0: fc0cf83e wrpin #$7c, #f8 c4: ff000002 augs #$400>>9 c8: f6040109 mov r0, #265 cc: f0640010 shl r0, #16 d0: f5440007 or r0, #7 d4: fc14003e wxpin r0, #f8 d8: 0d647c59 _ret_ drvh #$3e 000000dc : dc: fa97fe3e rqpin inb, #62 wc e0: fd6c7c40 testp #$3e wz e4: bc24003e if_nc_or_z wypin r0, #f8 e8: 4d9ffff0 if_c_and_nz jmp #d8 ec: fd64002d ret 000000f0 : f0: 019d28fb _ret_ sub $94, #251 wcz 000000f4 : f4: 019d28f8 _ret_ sub $94, #248 wcz 000000f8 : f8: 6c6c6548 if_c_ne_z wrlong #$32, ++ptra[8] fc: 6f57206f if_c_ne_z augs #$ae40de00>>9 100: 21646c72 if_nc_and_z addsx $36, #114 104: 00000a0d _ret_ ror r5, r13 bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ bash-3.2$ ../../binutils/readelf -a a.out ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Parallax Propeller Version: 0x1 Entry point address: 0x0 Start of program headers: 52 (bytes into file) Start of section headers: 400 (bytes into file) Flags: 0x10002 Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 1 Size of section headers: 40 (bytes) Number of section headers: 7 Section header string table index: 4 Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 000054 000108 00 AX 0 0 4 [ 2] .hub PROGBITS 00000108 00015c 000004 00 WA 0 0 4 [ 3] .hub_heap NOBITS 0000010c 000160 000004 00 WA 0 0 1 [ 4] .shstrtab STRTAB 00000000 000160 000030 00 0 0 1 [ 5] .symtab SYMTAB 00000000 0002a8 000310 10 6 22 4 [ 6] .strtab STRTAB 00000000 0005b8 00012c 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) There are no section groups in this file. Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000054 0x00000000 0x00000000 0x0010c 0x00110 RWE 0x4 Section to Segment mapping: Segment Sections... 00 .text .hub .hub_heap There is no dynamic section in this file. There are no relocations in this file. The decoding of unwind sections for machine type Parallax Propeller is not currently supported. Symbol table '.symtab' contains 49 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 SECTION LOCAL DEFAULT 1 2: 00000108 0 SECTION LOCAL DEFAULT 2 3: 0000010c 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 FILE LOCAL DEFAULT ABS crt0.o 5: 00000024 0 NOTYPE LOCAL DEFAULT 1 __bss_clear 6: 00000048 0 NOTYPE LOCAL DEFAULT 1 _start 7: 00000044 0 NOTYPE LOCAL DEFAULT 1 __C_LOCK_PTR 8: 00000000 0 FILE LOCAL DEFAULT ABS test.o 9: 0000003e 0 NOTYPE LOCAL DEFAULT ABS txpin 10: 0001c200 0 NOTYPE LOCAL DEFAULT ABS baud 11: 08d9ee20 0 NOTYPE LOCAL DEFAULT ABS clkrate 12: 00000509 0 NOTYPE LOCAL DEFAULT ABS _p2bitcycles 13: 000000f4 0 NOTYPE LOCAL DEFAULT 1 initval 14: 000000f0 0 NOTYPE LOCAL DEFAULT 1 clkval 15: 000000bc 0 NOTYPE LOCAL DEFAULT 1 init_uart 16: 0000006c 0 NOTYPE LOCAL DEFAULT 1 loop 17: 000000f8 0 NOTYPE LOCAL DEFAULT 1 msg 18: 00000084 0 NOTYPE LOCAL DEFAULT 1 done 19: 000000dc 0 NOTYPE LOCAL DEFAULT 1 tx 20: 00000090 0 NOTYPE LOCAL DEFAULT 1 leds 21: 00000000 0 FILE LOCAL DEFAULT ABS 22: 00000038 0 NOTYPE GLOBAL DEFAULT 1 r14 23: 000000b4 0 NOTYPE GLOBAL DEFAULT 1 __exit 24: 0000010c 0 NOTYPE GLOBAL DEFAULT 3 ___DTOR_LIST__ 25: 00000108 0 NOTYPE GLOBAL DEFAULT 1 _etext 26: 0000000c 0 NOTYPE GLOBAL DEFAULT 1 r3 27: 00000024 0 NOTYPE GLOBAL DEFAULT 1 r9 28: 00000108 0 NOTYPE GLOBAL DEFAULT 2 __C_LOCK 29: 00000018 0 NOTYPE GLOBAL DEFAULT 1 r6 30: 00000010 0 NOTYPE GLOBAL DEFAULT 1 r4 31: 00000000 0 NOTYPE GLOBAL DEFAULT 1 r0 32: 0000010c 0 NOTYPE GLOBAL DEFAULT 2 __bss_end 33: 00000028 0 NOTYPE GLOBAL DEFAULT 1 r10 34: 0000010c 0 NOTYPE GLOBAL DEFAULT 3 ___hub_heap_start 35: 00000020 0 NOTYPE GLOBAL DEFAULT 1 r8 36: 0000010c 0 NOTYPE GLOBAL DEFAULT 3 ___CTOR_LIST__ 37: 0000010c 0 NOTYPE GLOBAL DEFAULT 2 __bss_start 38: 00000050 0 NOTYPE GLOBAL DEFAULT 1 main 39: 0000001c 0 NOTYPE GLOBAL DEFAULT 1 r7 40: 0000003c 0 NOTYPE GLOBAL DEFAULT 1 lr 41: 0000010c 0 NOTYPE GLOBAL DEFAULT ABS __load_start_kernel 42: 00000040 0 NOTYPE GLOBAL DEFAULT 1 sp 43: 0000002c 0 NOTYPE GLOBAL DEFAULT 1 r11 44: 00000008 0 NOTYPE GLOBAL DEFAULT 1 r2 45: 00000030 0 NOTYPE GLOBAL DEFAULT 1 r12 46: 00000014 0 NOTYPE GLOBAL DEFAULT 1 r5 47: 00000004 0 NOTYPE GLOBAL DEFAULT 1 r1 48: 00000034 0 NOTYPE GLOBAL DEFAULT 1 r13 No version information found in this file. bash-3.2$ bash-3.2$ bash-3.2$ Script done on Sat Mar 19 16:53:47 2022