Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


help, storing input by first character and length into 3-byte entries

in MASM-

##program that prompts users for successive lines of text. Input ends when user enters a line beginning with a period.

&& build of a single BUFFER of the text entered, with the lines adjoined in the order in which they read.

&& After line have been read, build up an index of words found in the text.

**The index consists of items - one for each word - each
consisting of a:

<>a 16-bit value holding the offset within the text
buffer of the first character of the word

<>a 8-bit value hoding the length(in characters) of the

&& after index is built display the lists of all the words in the index

*use indirect addressing and or indexed operands
*at most 1000 characters total in the lines read
*at most 500 different words to be indexed
*all letters entered are uppercase
*a word may contain an apostrophe, otherwise, nonletter are
considered word delimeters
*each entered line is at most 100 characters long
*user starts

Jim did what
INDEX ENTRY~~~~~~~~~~~~~~~~~~~~~~~~~~~


use loop to skip over nonletters
stop when letter is located
record where letter is at, & length
keep moving over nonletters until finding letter

index ----3 byte enteries
1st two byte entries
last entry byte
problem: laying out index area, intrept two byte memory to word using PTR command

so far i got the buffer to work, i am having problems with the index part.
here is my code so far:=


outcome DWORD ? ;zero is valid; nonzero is invalid
prompt BYTE "Enter successive lines of text:",0

newLine BYTE 0Dh, 0Ah, 0 ;a return

buffer WORD 1000
index WORD 0

call Clrscr

mov ecx, 100
mov edx, OFFSET prompt
call WriteString
mov edx, OFFSET buffer

call ReadString

cmp buffer, 2Eh
je Last
jmp L1

Last: exit ; exit to operating system
main ENDP


END main


  • Shawn CarterShawn Carter Member Posts: 0

    / / free video tutorials and ebooks about \ Ruby C Visual Basic .NET R Visual Basic PL/SQL Scratch Java Assembly MATLAB Perl Delphi Objective-C Python PHP Swift Go JavaScript C++ C# Crystal Lua Fortran Prolog Scheme Erlang Clojure SAS Alice Kotlin LabVIEW Apex ABAP Logo Ada Hack Scala FoxPro D ML Lisp COBOL Rust F# Transact-SQL Dart VBScript Bash Julia Awk \

Sign In or Register to comment.