HELP: Problem with displaying table grades 
Author Message
 HELP: Problem with displaying table grades

Hi, I'm having troubles with printing the table grades to the screen.
It prints the first row correctly but the second and next ones are
being print in a different (incorrect) way.

It suppose to print the entire table to the screen in a nice format
(one course per line, columns lined up, each line numbered). Passing
grades printed in green, failing in red and grades that do not get
computed in GPA in yellow.

Can someone give me some hints, or perhaps corrections to the code?

Thank you!

I appreciate you time.

Here is the code:

(or download the attachment because the code looks little bit
different below, it's not lined up nicely)

TITLE    PROJECT2 (EXE)          GRADE POINT AVERAGE
;============================================================================
         .MODEL SMALL
         .STACK 64
;============================================================================
         .DATA
GRADES   DB 'CSCI 101  3B+ '
                  DB 'MATH 111  4A- '
                  DB 'PHYS 104  4INC'
                  DB 'CSCI 300  3F  '
                  DB 'CSCI 341  3A+ '
                  DB 'PHYS 103  5C- '
                  DB 'MATH 112  4B- '
                  DB 'CSCI 203  3B  '
                  DB 'CSCI 141  3A  '
                  DB 'CSCI 220  3C  '
                  DB 'CSCI 241  3D  '
                  DB 'MATH 130  4C+ '
                  DB 'MATH 120  3D+ '
                  DB 'MATH 241  3WF '
                  DB 'CSCI 350  3WU '    
                  DB 210 DUP (?)

DesiredD DB 00010111b
ROW      DB ?
COL      DB ?
PassG    DB 00110010b
NormalD  DB 00110111b

;============================================================================
         .CODE
BEGIN    PROC FAR

         MOV  DS,AX                
         MOV  ES,AX                  

         CALL CLRSC

         LEA  BP,GRADES
         MOV  Row,5
         MOV  Col,58

         CALL CURS

LOP:
         INC  Row
         MOV  Col,58

         ; COURSE
         ;===========
COURSE   PROC NEAR

        ; ADD  BP,5
         MOV  CX,5
         MOV  Col,63
         CALL DISP

COURSE   ENDP

         ; CREDIT NUMBER
         ;===========
CNUMBER  PROC NEAR

         ADD  BP,5
         MOV  CX,5
         MOV  Col,68
         CALL DISP

CNUMBER  ENDP

         ; CREDIT
         ;===========
CREDIT   PROC NEAR

         ADD  BP,1
         MOV  CX,1
         MOV  COL,69
         CALL DISP

CREDIT   ENDP

         ; GRADE
         ;===========
GRADE    PROC NEAR

         ADD  BP,3
         MOV  CX,3
         MOV  Col,72
         CALL DISP
         CMP  Row,20

         JNE  LOP
         JMP  EXIT

GRADE    ENDP

DISP     PROC NEAR

         MOV  AH,13H
         MOV  AL,01
         MOV  BH,0
         MOV  BL,DesiredD
         MOV  CX,5
         MOV  DH,Row
         MOV  DL,Col
         INT  10H
         RET

DISP     ENDP

CLRSC    PROC NEAR

         MOV  AX,0600H
         MOV  BH,71H
         MOV  CX,0000H
         MOV  DX,184FH
         INT  10h
         RET

CLRSC    ENDP

CURS     PROC NEAR

         MOV AH,02H
         MOV BH,00
         MOV DH,ROW
         MOV DL,COL
         INT 10H
         RET

CURS     ENDP

EXIT:
         MOV  AX,4C00h                 ;End processing
         INT  21h                             ;Call DOS

BEGIN    ENDP                          ;End of procedure
END      BEGIN                          ;End of program
;============================================================================



Thu, 27 Sep 2001 03:00:00 GMT  
 HELP: Problem with displaying table grades

Quote:

> Hi, I'm having troubles with printing the table grades to the screen.
> It prints the first row correctly but the second and next ones are
> being print in a different (incorrect) way.

When you jump to the top of the loop, bp still points
to grade. You need to "add bp,5" near the bottom of the
loop to advance it to the start of the next line.
Have fun calculating GPA :)

NASM problem: After translating the rest of the code to
NASM syntax so I could play with it, I was unsure if the
construct (existing only in the uuencoded post):
COMMENT %
    nice box with authors name,etc,
    including "box" characters
    ...
%
was supported. Figured I'd try it rather than type in all
those semicolons. Bad idea! NASM hung hard - had to go for
the Big Red Switch. (this is pre-release 3.6 in real-mode
DOS) In a Win98 Dos box, it reported "illegal operation"
at 0000:0017  (but left my mouse disabled). Is this behavior
known? I wouldn't expect unsupported syntax to work, but am
surprised NASM feels so strongly about it! Any clues?
TIA,
Frank



Fri, 28 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP: Problem with displaying table grades - gpa.asm (0/1)

2. help...prob with disp table grades - PROJECT2.asm (0/1)

3. REXX Table dialog display problem

4. HELP Urgent: Error in Up-grade to CA TOOLS III B from Original Version

5. Help - Partition Table problem - Lost access to extended partition

6. Listbox display problem - help!

7. String display problem within threads help!

8. Display Ints problem..Help!

9. Need HELP with strange DISPLAY problem

10. Need Help in determining DISPLAY problem

11. Problem with displaying help/tktml & hv.tcl

12. Displaying MSSQL table layouts in Browse

 

 
Powered by phpBB® Forum Software