--- title: "TRA1 and TRA2" id: 72979 type: "computer_media" slug: "tra1-and-tra2" url: "http://localhost/computer_media/tra1-and-tra2/" markdown_url: "http://localhost/computer_media/tra1-and-tra2.md" published_at: "2026-10-27T21:30:09+00:00" modified_at: "2026-10-27T21:30:09+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Two SuperBASIC programs that build QDOS TRA tables, one translating characters sent to the serial port and one replacing the error messages." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Jan Bredenbeek" slug: "jan-bredenbeek" taxonomy: "indiv" url: "http://localhost/indiv/jan-bredenbeek/" genre: - name: "RS232" slug: "rs232" taxonomy: "genre" url: "http://localhost/type/rs232/" media_type: "Diskette" programmers: - name: "Jan Bredenbeek" slug: "jan-bredenbeek" taxonomy: "indiv" url: "http://localhost/indiv/jan-bredenbeek/" download_url: "https://archive.org/download/timex-sinclair-software-archive/TRA1%20and%20TRA2%20%281986%29%28Bredenbeek%2C%20Jan%29%28Sinclair%20QL%29%28NL%29%28Program%29.zip" mediadate: "1986" article_media: - id: 46763 title: "TRA_BAS 1.2 RS-232 Translation" type: "article" url: "http://localhost/article/tra_bas-1-2-rs-232-translation/" media_type_tags: "RS232" license: false --- # TRA1 and TRA2 These two programs build tables for the QDOS `TRA` command. `TRA1_bas` asks for character codes and up to three replacement codes each and builds a translation table for the RS-232 ports, for printers that need different codes; `TRA2_bas` builds a table that redefines the system error reports. The REMs credit Jan Bredenbeek of Hilversum and date the programs 13 April and 7 March 1986. The article “TRA_BAS 1.2 RS-232 Translation” describes an enhanced version of TRA1_bas. ## Program Analysis Both reserve 1 KB with `RESPR` and start the table with the word $4AFB that `TRA` checks for; `TRA1_bas` fills a 256-byte one-to-one table before applying your replacements. It came from a QL owner’s floppy copies of QUANTA and IQLUG library material, imaged double-stepped so that only half of each disk survived; this file read back complete. The download holds the files exactly as recovered and a QL5A floppy image, *TRA1 and TRA2.img*, with the same files and their QDOS headers. Mount the image as FLP1_ (drop it on the QLRun page, or use it as a floppy image in sQLux, QPC2 or Q-emuLator) and type `lrun flp1_TRA1_bas`. In the image copies only, `mdv1_tra_list` reads `flp1_tra_list` so the program finds its files on the floppy. Tested in QLRun with the JS ROM as far as its first prompt. ## Source Code ``` 100 REMark TRA-command for RS232-translations 110 REMark Jan Bredenbeek, Hilversum 120 REMark 1986 April 13 130 : 140 DIM v(3) 150 start=RESPR(1024) 160 POKE_W start,19195: REMark $4AFB 170 table_a=start+6: table_b=start+262 180 POKE_W start+2,table_a-start: POKE_W start+4,table_b-start 190 FOR i=0 TO 255:POKE table_a+i,i 200 pointer=table_b+1 210 ncodes=0 220 CLS 230 REPeat loop 240 INPUT "Code ? (ENTER to stop)"!a$ 250 IF a$="" THEN EXIT loop 260 REPeat loop1 270 INPUT "Number of repace codes (1-3) ?"!n 280 IF n>0 AND n<4 THEN EXIT loop1 290 END REPeat loop1 300 FOR i=1 TO n 310 INPUT "replacecode"!(i);"?:"!v(i) 320 END FOR i 330 IF n=1 THEN 340 POKE table_a+a$,v(1) 350 ELSE 360 POKE table_a+a$,0 370 POKE pointer,a$ 380 FOR i=1 TO n:POKE pointer+i,v(i) 390 ncodes=ncodes+1 400 pointer=pointer+4 410 END IF 420 END REPeat loop 430 POKE table_b,ncodes 440 TRA start,0 450 SBYTES mdv1_tra_list,start,pointer-start 460 PRINT "You may reload your codes with:" 470 PRINT "a=RESPR(";pointer-start;")" 480 PRINT "LBYTES mdv1_tra_list,a" 490 PRINT "TRA a" 500 REMark *** end of listing TRA1_bas *** ```