I just started assembly programming, x86, and I am kind of getting the hang of it, but I am still far from becoming great at it. It's interesting to see what I do in Java from a different view. Anyways, for the life of me, I can't figure out what I am doing wrong. This is an assignment, and I don't expect to be handed my entire assignment, but I am running into all kinds of errors and would appreciate any help. I commented out a lot of it and am taking smaller steps. There is an example in the book that has some similarities in what I have done that's not commented out, but I was given an error. The book's example includes Irvinge32.inc, but I have no idea what that is. The thing is that "The NTVDM CPU has encountered an illegal instruction. CS:0594 IP:0037 OP:ff ff 75 03 e9" error. I have no idea why this is happening. Thank you for your time and effort.

.MODEL SMALL
.386p	;Needed for 32-bit instructions(movsx and movzx)
.STACK 512

word1 EQU 10000000b				;set word1 to -128 in binary

.DATA

  ;bytes db 10 DUP (0)		;using DUP, creates a ten zeroes in memory
  dec_byte1 db  25d				;decimal byte, symbol is d or t
  dec_byte2 db  2d				;decimal byte
  dec_byte3 db  10d				;decimal byte
 ; bin_byte	db	00011001b		;binary byte
 ; oct_byte 	db	031q			;octal byte, symbol is q or o
 ; hex_byte 	db	19h				;hexadecimal byte
 ; str1		db	'String'		;string
 ; word2		dw  ?				;unitilialized, then filled with 10000000b
  dec_fill	db  ?				;byte that is uninitialized
  ;empty		db	0b				;0
  ;doubword	dd  12345678h		;doubleword, unsigned
  ;quadword  dq  1234567812345678h		;quadword
  ;tenbyte   dt  1000000000123456789Ah	;tenbyte
  
  ;fill2		EQU word ptr bin_byte	;dec_byte into fill2 variable
  
.CODE
STARTPOINT:
    mov ax,@data
	mov ds,ax			;set DS to point to the data segment
	
	;Byte Operations
	mov		al, dec_byte1	;gets the dec_byte1 value
	sub		al, dec_byte2	;subtracts dec_byte2 value from the dec_byte1 value
	add		al, dec_byte3 	;adds the dec_byte3 value from the dec_byte1 value
	inc		al				;increases the value in al by 1
	mov 	dec_fill, al
	
	
	;mov 	al, word1		;puts word1 into al
	;mov 	bl, byte ptr word1 ;puts word1 into bl
	
	;Word operations
	;mov		ax, fill2
	;mov 	bx, word2
	
	;Miscellaneous operations
	;push	ax
	;pop		bx
	;mov		al, OFFSET str1
	;xchg	bh, bl
	
END STARTPOINT; This line is a must in every assembly language program

Never mind. I got into a panic and gave up too soon. Sorry to bother you guys! After redoing some stuff and a little more reading, I fixed all of my issues.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.