[VB81] How to enter an ASM/Basic listing codes.

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

[VB81] How to enter an ASM/Basic listing codes.

Post by XavSnap »

HI all,


Reminder…

ASM listings

To enter a machine code listing, i use to load it in Vb81, in text mode.

1 REM [ HEX: AA,FF,3A ]
or
2 REM [ DEC: 1,2,3 ]

I load it in the files explorer as is in text mode (.TXT or *.BAS) with the basic commands and other lines.

To save a binary, to export in Spectrum, Amstrad… emulators...
I open the "disassembler windows" (Achtung: this isn't a CPU debugger, but a line-by-line user debugger!)
Select the REM number tab, and save the binary Between the low and the higher address in the dedicated box)

The higher or the lower value can be move [USER], but the REM line number isn't retrieved (Ram_Top, lower/higher memory…)

To load a binary, select a REM, the binary will be filled in the free REM memory room… and trimmed if le binary is too big.

If the selected room is higher than the binary, the binary will be fill at the begin of lower address selected.
vbhex.JPG

To type or change a REM LINE:

Use the [TOOLS] [type in ASM #]
Select the REM line, select the Decimal or the Hexadecimal text box… and type it !
Note: in case of a new REM line, create a text file with "plenty of something", and load it has a text file.
vbhex1.JPG

Use the [Binary Editor #]:
Click and select the edition mode on the Left window side.
Click on the binary code, and Change the value in Hexadecimal.
1-F: Hexadecimal value.
CTRL+A : Text value "A"
CTRL+ALT+A : Inverted "A"
Select the [!] icon (left bottom icon after the green "refresh" icon"... to valid & return to the display mode.
Changes are assume in real time, but enable the "refresh" mode on demand.

To trim an ASM REM… whith too many spaces…
type (in the basic monitor)
SAVE"MYPROG.TXT"
Where SAVE="S", " = SHIFT + P …

Optional arguments:
SAVE"MYPROG.TXT;V;C;R;D"
- ':V' Save the Basic variables segment. (VARS memory)
- ':C' for CBI codes (by default Zx81 Basic functions)
- ':R' for ZxText2P ASCII chararacters codes.(by default Windows TTF Zx81_Riched font)
- ':D' to save ASM codes in decimal


To fixe the REM line to the right length, just save the Zx rem in the monitor, and edit the new text file and reload it in VB81 to save the P file using a simple SAVE"HELLO" (will be saved in the current work directory)
Last edited by XavSnap on Fri Apr 02, 2021 11:55 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [VB81] How to enter an ASM/Basic listing codes.

Post by XavSnap »

Basic listings:

All upper case are normal characters (Commands or variable strings)
All low case are assume as inverted characters.

*the % jocker put an inverted symbol (%?,%1,%2,%-,%+ etc.)

*the @ jocker is used to set a specific byte in a REM, a LET A$ or PRINT...
Like : 10 PRINT"@DE@E3THE TAPE" = 10 PRINT "THEN STOP THE TAPE"

*the \ jocker link the next line as the same line, to cut a line or draw a 32 columns screen.

10 PRINT "\
HELLO",," \
WORLD"


Use \" , @C0 or the "ZX81_riched" font to print a quotation mark in a PRINT command, between two quotes.

# is the ignore comment flag, but can't be use between two '\" flags or a BASIC line… it will be use as a new line. (HEX values in REMs can't be commented!)

Vb81 can read embedded graphics characters codes, and the old Zx2text converter too.
/:: = inverted space
/.. = bottom tab...

All over text are designed to work on Vb81, in ascii texts who can be directly launch in this emulator.
However, graphics characters can be display in the note-pad using the special TTF font enclosed in VB81.
Just open two "note-pad" like with your text program and the characters codes text.
Copy and paste all specials characters…

Examples and font downloads:

Code: Select all

# Notes:
# Both, Txt and Bas extensions can be 
# used... But, there's not a specific
# format assigned to bas or txt files
#   It's more convaignant to read a
#   old file without renaming them.
# The ZxBasic format need a special
# Zx81 font inclued in it or in
# the ZxToken project.
# @ 
# http://dskcenter.free.fr/zxtools.html
#
# You had to install this FON or TTF
# on your computer, to get the proper
# graphic chars display.
#
# This table can be used to cut/paste
# graphics chars or use "charmap.exe"
# in your windows directory.
# 
# In Vb81 XuR, save you Basic program
# using the ".TXT" extension in the
# ZX81 basic editor. It will create
# a Basic text file in the current
# directory. 
#
# Have Fun. /XavSnap/
# ZX81.Vb81@free.fr
# ZxBasic-ZxToken-Vb81 XuR projects.
#
  0  REM DEC/HX:ZXTEXT2P:ZXBASIC
 10  REM 000=00: " "    : " " <SPACE>
 20  REM 001=01: \'       : "¶" SHIFT+1
 30  REM 002=02: \ '      : "·" SHIFT+2
 40  REM 003=03: \''      : "¸" SHIFT+7
 50  REM 004=04: \.       : "¹" SHIFT+4
 60  REM 005=05: \:       : "º" SHIFT+5
 70  REM 006=06: \.'      : "»" SHIFT+T
 80  REM 007=07: \:'      : "¼" SHIFT+E
 90  REM 008=08: \##      : "½" SHIFT+A
100  REM 009=09: \,,      : "¾" SHIFT+D
110  REM 010=0A: \~~      : "¿" SHIFT+S
120  REM 011=0B: "      : "@0B"
130  REM 012=0C: £      : "£"
140  REM 013=0D: "$"    : "$"
150  REM 014=0E: ":"    : ":"
160  REM 015=0F: "?"    : "?"
170  REM 016=10: "("    : "("
180  REM 017=11: ")"    : ")"
190  REM 018=12: ">"    : ">"
200  REM 019=13: "<"    : "<"
210  REM 020=14: "="    : "="
220  REM 021=15: "+"    : "+"
230  REM 022=16: "-"    : "-"
240  REM 023=17: "*"    : "*"
250  REM 024=18: "/"    : "/"
260  REM 025=19: ";"    : ";"
270  REM 026=1A: ","    : ","
280  REM 027=1B: "."    : "."
290  REM 028=1C: "0"    : "0"
300  REM 029=1D: "1"    : "1"
310  REM 030=1E: "2"    : "2"
320  REM 031=1F: "3"    : "3"
330  REM 032=20: "4"    : "4"
340  REM 033=21: "5"    : "5"
350  REM 034=22: "6"    : "6"
360  REM 035=23: "7"    : "7"
370  REM 036=24: "8"    : "8"
380  REM 037=25: "9"    : "9"
390  REM 038=26: "A"    : "A"
400  REM 039=27: "B"    : "B"
410  REM 040=28: "C"    : "C"
420  REM 041=29: "D"    : "D"
430  REM 042=2A: "E"    : "E"
450  REM 043=2B: "F"    : "F"
460  REM 044=2C: "G"    : "G"
470  REM 045=2D: "H"    : "H"
480  REM 046=2E: "I"    : "I"
490  REM 047=2F: "J"    : "J"
500  REM 048=30: "K"    : "K"
510  REM 049=31: "L"    : "L"
520  REM 050=32: "M"    : "M"
530  REM 051=33: "N"    : "N"
540  REM 052=34: "O"    : "O"
550  REM 053=35: "P"    : "P"
560  REM 054=36: "Q"    : "Q"
570  REM 055=37: "R"    : "R"
580  REM 056=38: "S"    : "S"
590  REM 057=39: "T"    : "T"
600  REM 058=3A: "U"    : "U"
610  REM 059=3B: "V"    : "V"
620  REM 060=3C: "W"    : "W"
630  REM 061=3D: "X"    : "X"
640  REM 062=3E: "Y"    : "Y"
650  REM 063=3F: "Z"    : "Z"
660  REM 064=40: "RND"  : "RND"
670  REM 065=41:"INKEY$": "INKEY$"
680  REM 066=42: "PI"   : "PI"
690  REM 067=43:  ?     :  ? 
700  REM 068=44:  ?     :  ? 
710  REM 069=45:  ?     :  ? 
720  REM 070=46:  ?     :  ? 
730  REM 071=47:  ?     :  ? 
740  REM 072=48:  ?     :  ? 
750  REM 073=49:  ?     :  ? 
760  REM 074=4A:  ?     :  ? 
770  REM 075=4B:  ?     :  ? 
780  REM 076=4C:  ?     :  ? 
790  REM 077=4D:  ?     :  ? 
800  REM 078=4E:  ?     :  ? 
810  REM 079=4F:  ?     :  ? 
820  REM 080=50:  ?     :  ? 
830  REM 081=51:  ?     :  ? 
840  REM 082=52:  ?     :  ? 
850  REM 083=53:  ?     :  ? 
860  REM 084=54:  ?     :  ? 
870  REM 085=55:  ?     :  ? 
880  REM 086=56:  ?     :  ? 
890  REM 087=57:  ?     :  ? 
900  REM 088=58:  ?     :  ? 
910  REM 089=59:  ?     :  ? 
920  REM 090=5A:  ?     :  ? 
930  REM 091=5B:  ?     :  ? 
940  REM 092=5C:  ?     :  ? 
950  REM 093=5D:  ?     :  ? 
960  REM 094=5E:  ?     :  ? 
970  REM 095=5F:  ?     :  ? 
980  REM 096=60:  ?     :  ? 
990  REM 097=61:  ?     :  ? 
1000 REM 098=62:  ?     :  ? 
1010 REM 099=63:  ?     :  ? 
1020 REM 100=64:  ?     :  ? 
1030 REM 101=65:  ?     :  ? 
1040 REM 102=66:  ?     :  ? 
1050 REM 103=67:  ?     :  ? 
1060 REM 104=68:  ?     :  ? 
1070 REM 105=69:  ?     :  ? 
1080 REM 106=6A:  ?     :  ? 
1090 REM 107=6B:  ?     :  ? 
1100 REM 108=6C:  ?     :  ? 
1110 REM 109=6D:  ?     :  ? 
1120 REM 110=6E:  ?     :  ? 
1130 REM 111=6F:  ?     :  ? 
1140 REM 112=70:  ?     :  ? 
1150 REM 113=71:  ?     :  ? 
1160 REM 114=72:  ?     :  ? 
1170 REM 115=73:  ?     :  ? 
1180 REM 116=74:  ?     :  ? 
1190 REM 117=75:  ?     :  ? 
1200 REM 118=76:  ?     :  ? 
1210 REM 119=77:  ?     :  ? 
1220 REM 120=78:  ?     :  ? 
1230 REM 121=79:  ?     :  ? 
1240 REM 122=7A:  ?     :  ? 
1250 REM 123=7B:  ?     :  ? 
1260 REM 124=7C:  ?     :  ? 
1270 REM 125=7D:  ?     :  ? 
1280 REM 126=7E:  ?     :  ? 
1290 REM 127=7F:  ?     :  ? 
1300 REM 128=80:  \::     : "«" <space>
1310 REM 129=81:  \.:     : "¬" SHIFT+Q
1320 REM 130=82:  \:.     : "ª" SHIFT+W
1330 REM 131=83:  \..     : "®" SHIFT+6
1340 REM 132=84:  \':     : "¯" SHIFT+R
1350 REM 133=85:  \ :     : "°" SHIFT+8
1360 REM 134=86:  \'.     : "±" SHIFT+Y
1370 REM 135=87:  \ .     : "²" SHIFT+3
1380 REM 136=88:  \@@     : "³" SHIFT+H
1390 REM 137=89:  \;;     : "´" SHIFT+G
1400 REM 138=8A:  \!!     : "µ" SHIFT+F
1410 REM 139=8B:  %"     : "†"
1420 REM 140=8C:  %£     : "‡"
1430 REM 141=8D:  %$     : "ˆ"
1440 REM 142=8E:  %:     : "‰"
1450 REM 143=8F:  %?     : "Š"
1460 REM 144=90:  %(     : "‹"
1470 REM 145=91:  %)     : "Œ"
1480 REM 146=92:  %>     : ""
1490 REM 147=93:  %<     : "Ž"
1500 REM 148=94:  %=     : ""
1510 REM 149=95:  %+     : ""
1520 REM 150=96:  %-     : "‘"
1530 REM 151=97:  %*     : "’"
1540 REM 152=98:  %/     : "“"
1550 REM 153=99:  %;     : "”"
1560 REM 154=9A:  %,     : "•"
1570 REM 155=9B:  %.     : "–"
1580 REM 156=9C:  %0     : "—"
1590 REM 157=9D:  %1     : "˜"
1600 REM 158=9E:  %2     : "™"
1610 REM 159=9F:  %3     : "š"
1620 REM 160=A0:  %4     : "›"
1630 REM 161=A1:  %5     : "œ"
1640 REM 162=A2:  %6     : ""
1650 REM 163=A3:  %7     : "ž"
1660 REM 164=A4:  %8     : "Ÿ"
1670 REM 165=A5:  %9     : " "
1680 REM 166=A6:  %A     : "a"
1690 REM 167=A7:  %B     : "b"
1700 REM 168=A8:  %C     : "c"
1710 REM 169=A9:  %D     : "d"
1720 REM 170=AA:  %E     : "e"
1730 REM 171=AB:  %F     : "f"
1740 REM 172=AC:  %G     : "g"
1750 REM 173=AD:  %H     : "h"
1760 REM 174=AE:  %I     : "i"
1770 REM 175=AF:  %J     : "j"
1780 REM 176=B0:  %K     : "k"
1790 REM 177=B1:  %L     : "l"
1800 REM 178=B2:  %M     : "m"
1810 REM 179=B3:  %N     : "n"
1820 REM 180=B4:  %O     : "o"
1830 REM 181=B5:  %P     : "p"
1840 REM 182=B6:  %Q     : "q"
1850 REM 183=B7:  %R     : "r"
1860 REM 184=B8:  %S     : "s"
1870 REM 185=B9:  %T     : "t"
1880 REM 186=BA:  %U     : "u"
1890 REM 187=BB:  %V     : "v"
1900 REM 188=BC:  %W     : "w"
1910 REM 189=BD:  %X     : "x"
1920 REM 190=BE:  %Y     : "y"
1930 REM 191=BF:  %Z     : "z"
1940 REM 192=C0:  \"     : À  SHIFT+Q
1950 REM 193=C1:  ?     :  ? 
2000 REM ¼¸¯ ¬¸ª ³¶³·³»³
2001 REM º«° ºo° ³³³³³³³ ¾½¿
2002 REM ª®¬ ¯®¼ ³¹³²³±³
ZxChars.JPG
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: [VB81] How to enter an ASM/Basic listing codes.

Post by XavSnap »

To get a reliable OCR !

Easy ?
No, many of OCRs get garbage or false text characters.
If you are lucky a little listing will be reliable, but the best way to get a good text from a picture will be to clean it and sleep all unneeded informations.

Seven steps to clean and prepare a listing picture:
1) Delete all unwanted chars and texts.( in case of multi-columns listing, just create one column listing to avoid to get a merged/rambled lines text)
2) Adjust the colour/grey level to get better black and cut the grey scale on the background.
3) Sharpen the blur of the picture to get a better contrast.
4) A squared character font is usually a problem for OCRs, just expend the height size to get an higher paper font.
5) The picture is now ready to the OCR process.

Throw the picture to a dedicated software, or online (HERE)
With the note-pad and a regular font, add all return to get lines, check all commands, line numbers and Basic structures…

Change the characters font, and add graphics characters using copy&paste from the Zx81 characters table…

Open VB81, and load the text program in it.
Save it in a 'P' format using the Basic monitor SAVE"HELLO", it will be save in the working directory.

Image

Have fun.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply