Month: June 2005
-
Use windbg as an external tools of Visual C++
Title : WinDbg (or any title you want) Command : C:\masm32\debug\windbg.exe (it is not a typical position, but it is where it is on my pc.) Arguments: -ee c++ -G -i “$(TargetDir)” -y “$(TargetDir)” -QY -logo -QSY -sdce -WF “$(ProjectFileName).WEW” “$(TargetPath)” (The commandline may be too long to execute, remove some switches if that happens.…
-
Error 3e6 with WriteFile
It looks like you will get error 3E6 when you call write file with an address not aligned to DWORD. ;===================================================================== ; hello.asm – Example Assembler program ; ; Author: Sheng Jiang ; Course: COSC 2425 ; Date: 5/23/05 ;===================================================================== .386 .MODEL flat, stdcall option casemap:none include windows.inc include kernel32.inc include masm32.inc includelib kernel32.lib includelib masm32.lib .DATA align 1 placeholder byte ?…
-
Lab5 Step4
;=====================================================================; DrawLine.asm – help routine to draw table lines; Author: Sheng_Jiang; Course: COSC 2425; Date: 6/24/05;===================================================================== INCLUDE lab5.inc .Code DrawTableLine PROC USES eax ecx esi, _TableWidth : DWORD, beginChar : BYTE, textBuffer:PTR BYTE, textLen :DWORD, fillChar:BYTE, endChar:BYTE LOCAL printtextlen : DWORD, totalTextLen :DWORD mov eax,_TableWidth sub eax,2 mov totalTextLen,eax ;totalTextLen=_TableWidth-2 .IF(totalTextLen>0) ;beginChar, the left border mov al,beginChar call WriteChar ;cut the text if it is too long ;printtextlen=min(_TableWidth-2,textlen); mov eax,textLen .IF(eax>totalTextLen) mov eax,totalTextLen mov printtextlen,eax ;overflow .ELSE mov printtextlen,eax .ENDIF mov ecx, printtextlen ; print the text part mov esi,textBufferDrawTableLinePrintText: ;if no text left,jump to fill the line jcxz DrawTableLineFillLine mov al,byte ptr [esi] call WriteChar inc esi loop DrawTableLinePrintText DrawTableLineFillLine: ;fill the rest of table line ;will…
-
Lab5 Draft3
reference: http://homepages.ius.edu/jfdoyle/c335/Html/ProcInvoke.htm ;=====================================================================; lab5.asm – build a program that displays the Fibonacci numbers for a user defined input upper bound; Author: Sheng_Jiang; Course: COSC 2425; Date: 6/23/05;===================================================================== .386 option casemap:none INCLUDE Irvine32.inc ; —————————————————————– ; include files that have MASM format prototypes for function calls ; —————————————————————– ; ———————————————— ; Library files that have definitions for function ; exports and tested reliable prebuilt code. ; ———————————————— includelib gdi32.lib includelib user32.lib includelib kernel32.lib includelib Irvine32.lib …
-
Lab5 Draft2
;===================================================================== ; lab5.asm – build a program that displays the Fibonacci numbers for a user defined input upper bound ; Author: Sheng_Jiang ; Course: COSC 2425 ; Date: 6/21/05 ;===================================================================== .386 .MODEL flat, stdcall option casemap:none include windows.inc ; always first include macros.asm ; MASM support macros ; —————————————————————– ; include files that have MASM…
-
Lab5 Draft1
;===================================================================== ; lab5.asm – build a program that displays the Fibonacci numbers for a user defined input upper bound ; Author: Sheng_Jiang ; Course: COSC 2425 ; Date: 6/15/05 ;===================================================================== .386 .MODEL flat, stdcall option casemap:none include windows.inc ; always first include macros.asm ; MASM support macros ; —————————————————————– ; include files that have MASM…
-
Lab4
;===================================================================== ; lab4.asm – Example function call to get the 20th Fibonacci number ;; Author: Sheng_Jiang ; Course: COSC 2425 ; Date: 6/13/05;===================================================================== .386 .MODEL flat, stdcall option casemap:none include windows.inc ; always first include macros.asm ; MASM support macros ; —————————————————————– ; include files that have MASM format prototypes for function calls ; —————————————————————–…
-
Assignment1
;===================================================================== ; Assignment1.asm – Homework Assignment 1 ; ; Author: Sheng_Jiang ; Course: COSC 2425 ; Date: 06/08/05 ;===================================================================== .386 .MODEL flat, stdcall option casemap:none include windows.inc include kernel32.inc include masm32.inc includelib kernel32.lib includelib masm32.lib .DATA ;Playing with flags FlagTest BYTE 0 SFlagTest SBYTE 0 ;Summing up a series of unsigned numbers DWORDArray DWORD 1,2,3,4,5,6,7,8,9,10…
-
Lab3
.386 .MODEL flat, stdcall option casemap:none include windows.inc include kernel32.inc include masm32.inc includelib kernel32.lib includelib masm32.lib .DATA val1 DWORD 10000h val2 DWORD 40000h val3 DWORD 20000h finalVal DWORD ? .CODE main PROC int 3 mov eax,val1 add eax,val2 sub eax,val3 mov finalVal,eax invoke ExitProcess, 0 main ENDP END main # makefile for Lab3 PROJECT…