Okay, so I've decided that it is finally time to learn z80 assembly! Following the recent boom in creation of topics like this, I began a thread. I'm going to read more into the 28 days tutorial tomorrow (more than the first page ), but for now I figured that I should get this started and bookmark my post so I don't forget it. (xD) For now, I'm using a sloppily modified version of the DCS SDK "environment." It will be a much cleaner mod very soon, however. At the moment it is CLI, but I am satisfied with the results, despite the sloppy coding (I was rushing to be able to start coding).
So... to actually begin this topic, I'm curious as to what kind of programs everyone believes a beginner should start making.
Also: source code from my first program (mainly from viewing other learning topics)!
Code:
And finally, my coding environment (Note: This *was* just for me, so I use some paths in MY %USERPROFILE%):
Code:
z80 Compiler (from SDK, sloppily modified; beware)
Code:
z80 Editor (Just NP++ with a file prompt)
Code:
Both the z80edit and z80comp batch files were compiled into an executable (*.exe), by the way.
So... to actually begin this topic, I'm curious as to what kind of programs everyone believes a beginner should start making.
Also: source code from my first program (mainly from viewing other learning topics)!
Code:
.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
.org $9D93 ;I understand Kerm doesn't like 40339, and I don't either.
.db t2ByteTok,tAsmCmp
Start:
bcall(_clrLCDFull)
ld hl,(0*256)+0
ld (CurRow),hl
ld hl,msg
bcall(_PutS)
bcall(_getKey)
bcall(_ClrLCDFull)
ret
msg:
.db "Cr-48s are over-"
.db " rated, aren't "
.db " they? "
.end
.end
And finally, my coding environment (Note: This *was* just for me, so I use some paths in MY %USERPROFILE%):
- z80 Command Prompt
Code:
@echo off
title z80 Assembly Compilation Prompt
cd "C:\Users\TechnoMonkey76\Documents\z80 Programming"
echo Type "z80comp" to compile a program, or...
echo Type "z80edit" to modify an existing program!
Code:
@echo off
cls
echo ----------------------------------
echo Doors CS Assembler\Compiler
echo Version 2.0
echo Written by Kerm Martian
echo http:\\www.Cemetech.net
echo ----------------------------------
echo ----- Assembling for the TI-83/84 Plus...
echo #define TI83P >tasm\zztemp.asm
@echo off
set CURRDIR=%CD%
:: First test to see if we are on NT or similar OS
:: The ony difference is how they handle the ampersand
> ~userin.vbs echo 1234&rem
type ~userin.vbs | find "rem" > nul
if errorlevel 1 goto WINNT
goto WIN9X
:WIN9X
> ~userin.vbs echo strUserIn = InputBox("Source File to Assemble (minus extension) ")
>> ~userin.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")
>> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~userin.bat")
>> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)
>> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)
>> ~userin.vbs echo ts.WriteLine "set userin=" & strUserIn
>> ~userin.vbs echo ts.Close
goto RUN
:WINNT
> ~userin.vbs echo strUserIn = InputBox("Source File To Assemble (minus extension)")
>> ~userin.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")
>> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~userin.bat")
>> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)
>> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)
>> ~userin.vbs echo ts.WriteLine "set userin=" ^& strUserIn
>> ~userin.vbs echo ts.Close
goto RUN
:RUN
:: Now run the created script
start /w wscript.exe ~userin.vbs
del ~userin.vbs
:: Now call the created batch file
call ~userin.bat
del ~userin.bat
if exist %USERIN%.asm type %USERIN%.asm >>"C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm\tasm\zztemp.asm"
if exist %USERIN%.z80 type %USERIN%.z80 >>"C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm\tasm\zztemp.asm"
if not exist %USERIN%.z80 (
if not exist %USERIN%.asm (
echo Error: File not found!
pause
cls
cmd /K "C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm\z80cmd.bat"
exit
))
if exist "%USERPROFILE%\Documents\z80 Programming\%USERIN%.8xp" move "%USERPROFILE%\Documents\z80 Programming\%USERIN%.8xp" "%USERPROFILE%\Documents\z80 Programming\%USERIN%.8xp.old"
cd "C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm"
cd tasm
brass zztemp.asm ..\exec\%USERIN%.bin -l ..\list\%USERIN%.list.html
if errorlevel 1 goto ERRORS
cd..
cd exec
..\tasm\binpac8x.py %USERIN%.bin
echo ----- %USERIN% for the TI-83/84 Plus Assembled and Compiled.
echo TI-83 Plus version is %USERIN%.8xp
goto DONE
:ERRORS
echo ----- There were errors.
cd %CURRDIR%
:DONE
del ..\tasm\zztemp.asm >nul
del %USERIN%.bin >nul
cd "C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm\exec"
copy %USERIN%.8xp "%USERPROFILE%\Documents\z80 Programming\%USERIN%.8xp" >nul
del %USERIN%.8xp
cd %CURRDIR%
Code:
@echo off
:: First test to see if we are on NT or similar OS
:: The ony difference is how they handle the ampersand
> ~userin.vbs echo 1234&rem
type ~userin.vbs | find "rem" > nul
if errorlevel 1 goto WINNT
goto WIN9X
:WIN9X
> ~userin.vbs echo strUserIn = InputBox("Source File to Edit (minus extension)")
>> ~userin.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")
>> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~userin.bat")
>> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)
>> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)
>> ~userin.vbs echo ts.WriteLine "set userin=" & strUserIn
>> ~userin.vbs echo ts.Close
goto RUN
:WINNT
> ~userin.vbs echo strUserIn = InputBox("Source File To Edit (minus extension)")
>> ~userin.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")
>> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~userin.bat")
>> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)
>> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)
>> ~userin.vbs echo ts.WriteLine "set userin=" ^& strUserIn
>> ~userin.vbs echo ts.Close
goto RUN
:RUN
:: Now run the created script
start /w wscript.exe ~userin.vbs
del ~userin.vbs
:: Now call the created batch file
call ~userin.bat
del ~userin.bat
if exist %USERIN%.asm set EXT=asm
if exist %USERIN%.z80 set EXT=z80
if not exist %USERIN%.z80 (
if not exist %USERIN%.asm (
echo Error: File not found!
pause
cls
cmd /K "C:\Users\TechnoMonkey76\Programs\z80 Dev\DCS SDK\asm\z80cmd.bat"
exit
))
"C:\Program Files (x86)\Notepad++\notepad++.exe" %USERIN%.%EXT%
Both the z80edit and z80comp batch files were compiled into an executable (*.exe), by the way.