I am sure I am leaving out a directive. Normally I use the irvine32 libraries but I think my errors are because I am trying to leave them out and go with raw masm.
Or I am missing something else.
*************basic logic***************
Struct definition
message definition
set cursor position
askUser proc
GetInput proc
call askUser
putchar
call writeString
makewin proc
Main proc
call makewin
call putchar
***************error**************
Assembling: newDOS1.asm
newDOS1.asm(6) : error A2119: language type must be specified
newDOS1.asm(7) : error A2119: language type must be specified
newDOS1.asm(8) : error A2119: language type must be specified
newDOS1.asm(20) : error A2034: must be in segment block
newDOS1.asm(21) : error A2034: must be in segment block
newDOS1.asm(58) : error A2119: language type must be specified
newDOS1.asm(58) : error A2111: conflicting parameter definition
newDOS1.asm(67) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(69) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(70) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(72) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(73) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(75) : error A2085: instruction or register not accepted in current C
PU mode
newDOS1.asm(88) : error A2119: language type must be specified
newDOS1.asm(147) : error A2006: undefined symbol : InName
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 3
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(147) : error A2006: undefined symbol : Mes1
newDOS1.asm(147) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(148) : error A2006: undefined symbol : InName
newDOS1.asm(148) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(68) : error A2006: undefined symbol : askUser
newDOS1.asm(71) : error A2006: undefined symbol : WriteString
newDOS1.asm(74) : error A2006: undefined symbol : ReadString
newDOS1.asm(96) : error A2006: undefined symbol : WriteString
newDOS1.asm(139) : error A2006: undefined symbol : DGROUP
newDOS1.asm(150) : error A2006: undefined symbol : Crlf
newDOS1.asm(155) : warning A4023: with /coff switch, leading underscore required
for start address : main
******program**************
TITLE The New DOS
.model small
.stack 100h
GetInput PROTO :DWORD, :DWORD, :DWORD
StringLength PROTO :DWORD
SwapIt PROTO :DWORD
WINDESC STRUCT
upperRow BYTE ?
leftCol BYTE ?
lowerRow BYTE ?
rightCol BYTE ?
foreColor BYTE ?
backColor BYTE ?
WINDESC ENDS
Mes1 BYTE "Enter a 5 digit string: ", 0
InName BYTE 6 dup(0)
exit MACRO
mov ax, 4C00h
int 21h
ENDM
.data
application WINDESC <05h, 05h, 15h, 45h, 07h, 10h>
.code
curpos PROC
push bp
mov bp, sp
push ax
push bx
push dx
mov ax, 0200h
mov bh, 0
mov dx, [bp+4]
; interrupt
int 10h
pop dx
pop bx
pop ax
pop bp
ret 2
curpos ENDP
OPTION PROLOGUE:None
OPTION EPILOGUE:None
GetInput PROC lpszString:DWORD, lpBuffer:DWORD, uLength:DWORD
;Call With: lpszString = pointer to message string
; lpBuffer = pointer to input buffer
; uLength = length of input buffer
;
; Returns: buffer is filled with user input
; ECX, EDX are destroyed
push ebp
call askUser
mov ebp, esp
mov edx, [ebp+8] ;lpszString
call WriteString
mov edx, [ebp+12] ;lpBuffer
mov ecx, [ebp+16] ;uLength
call ReadString
pop ebp
ret 12 ;return and discard 3 dwords
GetInput ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
;************************************************
OPTION PROLOGUE:None
OPTION EPILOGUE:None
putchar PROC lpszString:DWORD
push bp
mov bp, sp
push ax
push bx
push cx
push dx
call WriteString
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
putchar ENDP
makewin PROC
push bp
mov bp, sp
push ax
push bx
push cx
push dx
push si
mov si, [bp+4]
mov ax, 0600h
mov bh, (WINDESC PTR[si]) .backColor
mov ch, (WINDESC PTR[si]) .upperRow
mov cl, (WINDESC PTR[si]) .leftCol
mov dh, (WINDESC PTR[si]) .lowerRow
mov dl, (WINDESC PTR[si]) .rightCol
;interrupt
int 10h
push cx
call curpos
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
makewin ENDP
main PROC
mov ax, @data
mov ds, ax
mov ax, OFFSET application
push ax
call makewin
call putchar
INVOKE GetInput, offset Mes1, offset InName, sizeof InName
INVOKE SwapIt, offset InName
; call WriteString
call Crlf
exit
main ENDP
end main
- you are not specifying a default calling convention -> .model small, stdcall / c. Otherwise you must specify the calling convention when declaring the prototype and/or the procedure (PROC)
- masm requiring to specify a instruction set. The following lines should be enough:
.686p
.mmx
.xmm
a little bit better!
C:\Users\Brad\DOCUME~1\ASSEMB~1\ASM-PR~1>make16 newDOS1
Assembling: newDOS1.asm
newDOS1.asm(9) : error A2119: language type must be specified
newDOS1.asm(10) : error A2119: language type must be specified
newDOS1.asm(11) : error A2119: language type must be specified
newDOS1.asm(23) : error A2034: must be in segment block
newDOS1.asm(24) : error A2034: must be in segment block
newDOS1.asm(61) : error A2119: language type must be specified
newDOS1.asm(61) : error A2111: conflicting parameter definition
newDOS1.asm(91) : error A2119: language type must be specified
newDOS1.asm(150) : error A2006: undefined symbol : InName
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 3
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(150) : error A2006: undefined symbol : Mes1
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(151) : error A2006: undefined symbol : InName
newDOS1.asm(151) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(71) : error A2006: undefined symbol : askUser
newDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
newDOS1.asm(153) : error A2006: undefined symbol : Crlf
Press any key to continue . . .
I am stuck on these errors...
I know the readstring and writestring error are from me 'not' calling on the Irvine32 libraries. I am trying not to use them. How do I read and write without them?
********************errors*****************
Assembling: newDOS1.asm
newDOS1.asm(9) : error A2119: language type must be specified
newDOS1.asm(10) : error A2119: language type must be specified
newDOS1.asm(11) : error A2119: language type must be specified
newDOS1.asm(61) : error A2119: language type must be specified
newDOS1.asm(61) : error A2111: conflicting parameter definition
newDOS1.asm(91) : error A2119: language type must be specified
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(151) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
newDOS1.asm(142) : error A2006: undefined symbol : DGROUP
newDOS1.asm(153) : error A2006: undefined symbol : Crlf
newDOS1.asm(158) : warning A4023: with /coff switch, leading underscore required
for start address : main
**************program*****************
TITLE The New DOS
.model small
.stack 100h
.686p
.mmx
.xmm
GetInput PROTO :DWORD, :DWORD, :DWORD
SwapIt PROTO :DWORD
askUser PROTO :DWORD, :DWORD, :DWORD
WINDESC STRUCT
upperRow BYTE ?
leftCol BYTE ?
lowerRow BYTE ?
rightCol BYTE ?
foreColor BYTE ?
backColor BYTE ?
WINDESC ENDS
exit MACRO
mov ax, 4C00h
int 21h
ENDM
.data
Mes1 BYTE "Enter a 5 digit string: ", 0
InName BYTE 6 dup(0)
application WINDESC <05h, 05h, 15h, 45h, 07h, 10h>
.code
curpos PROC
push bp
mov bp, sp
push ax
push bx
push dx
mov ax, 0200h
mov bh, 0
mov dx, [bp+4]
; interrupt
int 10h
pop dx
pop bx
pop ax
pop bp
ret 2
curpos ENDP
OPTION PROLOGUE:None
OPTION EPILOGUE:None
GetInput PROC lpszString:DWORD, lpBuffer:DWORD, uLength:DWORD
;Call With: lpszString = pointer to message string
; lpBuffer = pointer to input buffer
; uLength = length of input buffer
;
; Returns: buffer is filled with user input
; ECX, EDX are destroyed
push ebp
call askUser
mov ebp, esp
mov edx, [ebp+8] ;lpszString
call WriteString
mov edx, [ebp+12] ;lpBuffer
mov ecx, [ebp+16] ;uLength
call ReadString
pop ebp
ret 12 ;return and discard 3 dwords
GetInput ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
;************************************************
OPTION PROLOGUE:None
OPTION EPILOGUE:None
putchar PROC lpszString:DWORD
push bp
mov bp, sp
push ax
push bx
push cx
push dx
call WriteString
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
putchar ENDP
makewin PROC
push bp
mov bp, sp
push ax
push bx
push cx
push dx
push si
mov si, [bp+4]
mov ax, 0600h
mov bh, (WINDESC PTR[si]) .backColor
mov ch, (WINDESC PTR[si]) .upperRow
mov cl, (WINDESC PTR[si]) .leftCol
mov dh, (WINDESC PTR[si]) .lowerRow
mov dl, (WINDESC PTR[si]) .rightCol
;interrupt
int 10h
push cx
call curpos
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
makewin ENDP
main PROC
mov ax, @data
mov ds, ax
mov ax, OFFSET application
push ax
call makewin
call putchar
INVOKE GetInput, offset Mes1, offset InName, sizeof InName
INVOKE SwapIt, offset InName
; call WriteString
call Crlf
exit
main ENDP
end main
as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified
this will fix that:
.model small,STDCALL
these:
QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
are Irvine library functions, if you don't want to use Irvine, then write your own :bg to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?
Also, how are you assembling and linking? if you are going to use @DATA you need to assemble and link as a DOS app not a console app
You can be helpful without being rude.
Quote from: Gunner on November 27, 2011, 02:08:33 AM
as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified
this will fix that: .model small,STDCALL
these:QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
are Irvine library functions, if you don't want to use Irvine, then write your own :bg to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?
secondly, I already stated I was dropping Irvine and a little confuzed about the errors from dropping the usage of the libraries.
You wanna point out where the MIGRATE from IRVINE manual is???
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere. That is the RUDEST statement one can make when you are trying to weed through little bullsh!t item.
So, I should read ANOTHER 400 pages just because Irvine didn't point out STDCALL
My word, you must be the moron...
Rude, rude RUDE you are!
You can be helpful without being rude.
Quote from: Gunner on November 27, 2011, 02:08:33 AM
as pointed out before: RTFM
QuotenewDOS1.asm(9) : error A2119: language type must be specified
this will fix that: .model small,STDCALL
these:QuotenewDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
are Irvine library functions, if you don't want to use Irvine, then write your own :bg to get rid of them, include irvine OR just open irvine32.asm and see what code he uses and modify to suit your needs?
Has nothing to do with Irvine, that is just a book and a library that uses MASM. I didn't need the book but I bought it to help folks with the many problems that you have. It assumes you have MASM installed via Visual Studio. Well, you can get samples, a humongous library to do just about everything, manuals, MASM and other various files from this forum up in the top right http://masm32.com/masmdl.htm, since you said you are trying to get away from Irvine, take a look at MASM32
bcddd214, are you trying to create a code to ms-dos?
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere.
OK, it seems you are getting desperate. Since I get the impression that you seriously want to learn assembler, I will give you some essential reading.
1. See my signature. The tips and tricks (http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm) contain essential steps to set up your proper non-Irvine environment
2. Download the guide from http://www.masm32.com/board/index.php?topic=5433.0
That is more than enough for the time being. Consider using MasmBasic (http://www.masm32.com/board/index.php?topic=12460), it has an extremely powerful macro called
deb that allows you to see the contents of variables and registers. Example:
Quoteinclude \masm32\MasmBasic\MasmBasic.inc
.data
MyReal4 REAL4 123.456
MyReal8 REAL8 987.654
MyQword QWORD 123456789012345678
Init
mov eax, 12345
movlps xmm0, MyReal8
movlps xmm1, MyQword
deb 4, "Somewhere in a loop:", eax, MyReal4, MyReal8, f:xmm0, MyQword, xmm1
Inkey Str$("\nYour puter has run %3f hours since the last boot, give it a break!", Timer/3600000)
Exit
end start
Output:
Somewhere in a loop:
eax 12345
MyReal4 123.4560
MyReal8 987.6540000000000
f:xmm0 987.6540000000000
MyQword 123456789012345678
xmm1 123456789012345678
Your puter has run 36.6 hours since the last boot, give it a break
This helps to understand how your code works, and is fully compatible with the Masm32 package. However, if you are stuck because your code crashes violently, OllyDbg (http://www.ollydbg.de/version2.html) is the tool to use - more complicated than deb but you can really see what's going on.
:thumbu
I apologize for being jest but RTFD isn't very nice sir.
Quote from: Gunner on November 27, 2011, 02:44:16 AM
Has nothing to do with Irvine, that is just a book and a library that uses MASM. I didn't need the book but I bought it to help folks with the many problems that you have. It assumes you have MASM installed via Visual Studio. Well, you can get samples, a humongous library to do just about everything, manuals, MASM and other various files from this forum up in the top right http://masm32.com/masmdl.htm, since you said you are trying to get away from Irvine, take a look at MASM32
On it, let me get up too par...
RTFDing it AGAIN...
:)
Quote from: jj2007 on November 27, 2011, 07:34:11 AM
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I already read irvine for crying out loud. so take your RTFM and shove it somewhere.
OK, it seems you are getting desperate. Since I get the impression that you seriously want to learn assembler, I will give you some essential reading.
1. See my signature. The tips and tricks (http://www.webalice.it/jj2006/Masm32_Tips_Tricks_and_Traps.htm) contain essential steps to set up your proper non-Irvine environment
2. Download the guide from http://www.masm32.com/board/index.php?topic=5433.0
That is more than enough for the time being. Consider using MasmBasic (http://www.masm32.com/board/index.php?topic=12460), it has an extremely powerful macro called deb that allows you to see the contents of variables and registers. Example:
Quoteinclude \masm32\MasmBasic\MasmBasic.inc
.data
MyReal4 REAL4 123.456
MyReal8 REAL8 987.654
MyQword QWORD 123456789012345678
Init
mov eax, 12345
movlps xmm0, MyReal8
movlps xmm1, MyQword
deb 4, "Somewhere in a loop:", eax, MyReal4, MyReal8, f:xmm0, MyQword, xmm1
Inkey Str$("\nYour puter has run %3f hours since the last boot, give it a break!", Timer/3600000)
Exit
end start
Output:
Somewhere in a loop:
eax 12345
MyReal4 123.4560
MyReal8 987.6540000000000
f:xmm0 987.6540000000000
MyQword 123456789012345678
xmm1 123456789012345678
Your puter has run 36.6 hours since the last boot, give it a break
This helps to understand how your code works, and is fully compatible with the Masm32 package. However, if you are stuck because your code crashes violently, OllyDbg (http://www.ollydbg.de/version2.html) is the tool to use - more complicated than deb but you can really see what's going on.
:thumbu
Quote from: jj2007 on November 27, 2011, 07:34:11 AM
Quote from: bcddd214 on November 27, 2011, 02:39:11 AM
I have trouble compiling my first hello world program using the software on that website you sent me too. So I haven't been able to read a lot of the help file (I will go looking manually and a moment) but on that website is very clearly states not to use esp or ebp where as the colleague that is acting as a mentor on the side has me neck deep inside of ebp and esp not because its the right thing to do but to show me how they work.
I saw the RED highlight next to it and I know your are scratching your head as to why this guy insist.
There is a WHOLE bunch of empty space esp leaves behind and ebp is your backdoor. Not for conventional programing I know this.
Also there is no need to refer me to the masmbasic. For this instructional I am pure masm and don't what additional libraries I could accidentally use either my friends so if I appear to be pulling in a direction it for a reason. please work with me and save the rtfd.
In a nutshell, you are trying to take me higher and I am trying to go lower. :)
Can someone kindly assist me with this last compile error?
Assembling: newDOS1.asm
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 2
newDOS1.asm(150) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(151) : error A2114: INVOKE argument type mismatch : argument : 1
newDOS1.asm(74) : error A2006: undefined symbol : WriteString
newDOS1.asm(77) : error A2006: undefined symbol : ReadString
newDOS1.asm(99) : error A2006: undefined symbol : WriteString
newDOS1.asm(143) : error A2006: undefined symbol : DGROUP
newDOS1.asm(153) : error A2006: undefined symbol : Crlf
**********************************************************
TITLE The New DOS
.model small, STDCALL
.stack 100h
.686p
.mmx
.xmm
GetInput PROTO :DWORD, :DWORD, :DWORD
SwapIt PROTO :DWORD
askUser PROTO :DWORD, :DWORD, :DWORD
WINDESC STRUCT
upperRow BYTE ?
leftCol BYTE ?
lowerRow BYTE ?
rightCol BYTE ?
foreColor BYTE ?
backColor BYTE ?
WINDESC ENDS
exit MACRO
mov ax, 4C00h
int 21h
ENDM
.data
Mes1 BYTE "Enter a 5 digit string: ", 0
InName BYTE 6 dup(0)
application WINDESC <05h, 05h, 15h, 45h, 07h, 10h>
.code
curpos PROC
push bp
mov bp, sp
push ax
push bx
push dx
mov ax, 0200h
mov bh, 0
mov dx, [bp+4]
; interrupt
int 10h
pop dx
pop bx
pop ax
pop bp
ret 2
curpos ENDP
OPTION PROLOGUE:None
OPTION EPILOGUE:None
GetInput PROC lpszString:DWORD, lpBuffer:DWORD, uLength:DWORD
;Call With: lpszString = pointer to message string
; lpBuffer = pointer to input buffer
; uLength = length of input buffer
;
; Returns: buffer is filled with user input
; ECX, EDX are destroyed
push ebp
call askUser
mov ebp, esp
mov edx, [ebp+8] ;lpszString
call WriteString
mov edx, [ebp+12] ;lpBuffer
mov ecx, [ebp+16] ;uLength
call ReadString
pop ebp
ret 12 ;return and discard 3 dwords
GetInput ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
;************************************************
OPTION PROLOGUE:None
OPTION EPILOGUE:None
putchar PROC lpszString:DWORD
push bp
mov bp, sp
push ax
push bx
push cx
push dx
call WriteString
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
putchar ENDP
makewin PROC
push bp
mov bp, sp
push ax
push bx
push cx
push dx
push si
mov si, [bp+4]
mov ax, 0600h
mov bh, (WINDESC PTR[si]) .backColor
mov ch, (WINDESC PTR[si]) .upperRow
mov cl, (WINDESC PTR[si]) .leftCol
mov dh, (WINDESC PTR[si]) .lowerRow
mov dl, (WINDESC PTR[si]) .rightCol
;interrupt
int 10h
push cx
call curpos
pop si
pop dx
pop cx
pop bx
pop ax
pop bp
ret 2
makewin ENDP
main PROC
mov ax, @data
mov ds, ax
mov ax, OFFSET application
push ax
call makewin
call putchar
INVOKE GetInput, offset Mes1, offset InName, sizeof InName
INVOKE SwapIt, offset InName
; call WriteString
call Crlf
exit
main ENDP
end main
Quote from: bcddd214 on November 28, 2011, 06:30:29 AM
In a nutshell, you are trying to take me higher and I am trying to go lower. :)
Quote
I have trouble compiling my first hello world program using the software on that website you sent me too. So I haven't been able to read a lot of the help file...
Also there is no need to refer me to the masmbasic. For this instructional I am pure masm and don't what additional libraries
Before going anywhere, you should learn how to walk. To understand what your code does, you need either a debugging macro (deb) or Olly. Without, you are just "flying blind", getting crashes or error messages.
Only very advanced programmes gain something from fumbling with esp and ebp, all others just get headaches.
No programmer, even very advanced ones, can code without libraries. Even a simple int 21h calls a library.
By the way, the last code you posted is 16-bit (obsolete), and you get the error because you have a bad combination of commandline switches and ml.exe version.
Quote from: bcddd214 on November 27, 2011, 01:58:14 AM
I know the readstring and writestring error are from me 'not' calling on the Irvine32 libraries. I am trying not to use them. How do I read and write without them?
Using interruptions, or acessing the IO ports direct, or some location in memory. You can use ms-dos interruptions(more easy to start) , do a search in 16 bit DOS Programming section of this board, I'm supposing this because you are using "4C00h, int 21h", so this makes me think that you are building an .exe to ms-dos 16 bits, instead of .com (int 20h).
The code below was found inside this board.
.model small
.stack 100h
.data
message db "Hello World", 13, 10, "$"
.code
start:
mov ax, @data
mov ds, ax
mov dx, offset message ; copy address of message to dx
mov ah, 9h ; subprogram for string output
int 21h ; call ms-dos to display string
mov ax, 4c00h
int 21h
end start
ml /Bllink16.exe hello.asm
Remember, that you need put yourself in time. To easy starting code to ms-dos, do not work with dword's(for a while), in that era, we deal with "word". So, edx mean dx, eax mean ax, ... .
The challenge is: rewrite this example to output strings using bios interruptions (int 10h), after, memory location, after, IO (you will learn about in/out instructions, and addresses of corresponding ports/machine architecture)(Ralph Brown list). Start again the same way but now, getting user input.
When you reach the last step, you are able to write bcddd214 O.S (a simple one, that only show "welcome to bcddd214 O.S. v0.0"). Now, you are able to create your own interruptions to you O.S (learn about cli/sti instructions). So, after, you read ml laws and discover that you cannot create your O.S using ml :/ . Time to change of assembler.
Not for what this project entails my friend.
I need/have too stay CLEAR of anything high level.
I am and have been hooked on asm since I started to learn it but, knuckle busting through the really LOW level (like manipulating the stack frame pointer to your advantage or at least control it) is REALLY important right now.
All task I have assigned to myself involve manipulation of the registers mainly esp and ebp to develop a clear understanding of how they work. This task is a tiny bit high than just learning asm. (most will view this as a waste of time, but it is not).
Thank you kindly for your perspective though and your support.
Making the changes now... :)
Thank you!
On it!
This is wonderful!
Quote from: mineiro on November 28, 2011, 06:05:57 PM
Quote from: bcddd214 on November 27, 2011, 01:58:14 AM
I know the readstring and writestring error are from me 'not' calling on the Irvine32 libraries. I am trying not to use them. How do I read and write without them?
Using interruptions, or acessing the IO ports direct, or some location in memory. You can use ms-dos interruptions(more easy to start) , do a search in 16 bit DOS Programming section of this board, I'm supposing this because you are using "4C00h, int 21h", so this makes me think that you are building an .exe to ms-dos 16 bits, instead of .com (int 20h).
The code below was found inside this board.
.model small
.stack 100h
.data
message db "Hello World", 13, 10, "$"
.code
start:
mov ax, @data
mov ds, ax
mov dx, offset message ; copy address of message to dx
mov ah, 9h ; subprogram for string output
int 21h ; call ms-dos to display string
mov ax, 4c00h
int 21h
end start
ml /Bllink16.exe hello.asm
Remember, that you need put yourself in time. To easy starting code to ms-dos, do not work with dword's(for a while), in that era, we deal with "word". So, edx mean dx, eax mean ax, ... .
The challenge is: rewrite this example to output strings using bios interruptions (int 10h), after, memory location, after, IO (you will learn about in/out instructions, and addresses of corresponding ports/machine architecture)(Ralph Brown list). Start again the same way but now, getting user input.
When you reach the last step, you are able to write bcddd214 O.S (a simple one, that only show "welcome to bcddd214 O.S. v0.0"). Now, you are able to create your own interruptions to you O.S (learn about cli/sti instructions). So, after, you read ml laws and discover that you cannot create your O.S using ml :/ . Time to change of assembler.
I think that he is telling you that you have to define the STDCALL for the assembler, so that it knows your calling convention.