| | |
separating strings
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi
use this :
GoodLuck .
use this :
Assembly Syntax (Toggle Plain Text)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Source Name : StrSpr.ASM ;; ;; Executable Name : StrSpr.COM ;; ;; Code Model : Real mode flat model ;; ;; Created Date : 29/09/2006 ;; ;; Author : VIDOCQ ;; ;; Description : A simple example of a DOS .COM ;; ;; file programmed using NASM 0.98 ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [BITS 16] [ORG 0x100] [SECTION .text] %macro Write 2 ;ShowIt,ShowLength mov BX,1 ; Selects DOS file handle 1: Standard Output mov CX,%2 ; ShowLength: Length of string passed in CX mov DX,%1 ; Showit: Offset address of string passed in DX mov AH,40H ; Select DOS service 40: Print String int 21H ; Call DOS %endmacro start : mov AX,[mystr] mov WORD [num1],AX mov AH,[mystr+2] mov BYTE [operator],AH mov AX,[mystr+3] mov WORD [num2],AX Write num1,2 Write CRLF,2 Write operator,1 Write CRLF,2 Write num2,2 ret [SECTION .data] mystr DB "24+67" num1 DW 0 num2 DW 0 operator DB 0 CRLF DW 0D0AH ;;----- End of file-----;;
GoodLuck .
![]() |
Similar Threads
- CSV file (C)
- Please help me compare strings (Java)
- C++ handling of strings in a boolean expression (C++)
- Compare strings... (C++)
- comparing two strings with linear search.. (Java)
- JSP and Oracle (JSP)
Other Threads in the Assembly Forum
- Previous Thread: I have problem about Knapsack in ASM
- Next Thread: Where can i learn about assembly language
| Thread Tools | Search this Thread |
Tag cloud for Assembly





