So my program is supposed to ask the user for a hex and decode the Mpeg for the Version, Layer Description, and sampling rate. So My problem is getting the smapling rate any suggestions?
TITLE CS2650 Assembler Assignment #3 Template
; Student Name: Cody Squadroni
; Assignment Due Date: 11/25/2012
INCLUDE Irvine32.inc
.data
;--------- Enter Data Here
vSemester BYTE "Fall",0
vAssignment BYTE "Assembler",0
vName BYTE "Name",0
vMP3Header BYTE "Enter MP3 Frame Header in Hex: ",0
vMpeg25 BYTE "MPEG Version 2.5",0
vMpeg20 BYTE "MPEG Version 2.0",0
vMpeg10 BYTE "MPEG Version 1.0",0
vMpegRE BYTE "MPEG Reserved",0
vLayerRE BYTE " Reserved",0
vLayerIII BYTE " Layer III",0
vLayerII BYTE " Layer II",0
vLayerI BYTE " Layer I",0
.code
main PROC
;--------- Enter Code Below Here
call Clrscr
call DisplaySemester
call DisplayAssignment
call DisplayName
call ReadMP3Header
call DisplayVersion
call DisplayLayer
;Call SamplingRate
;Semester
DisplaySemester:
mov dh, 12
mov dl, 12
call Gotoxy
mov edx, OFFSET vSemester
call WriteString
;Assignment
DisplayAssignment:
mov dh, 13
mov dl, 12
call Gotoxy
mov edx, OFFSET vAssignment
call WriteString
;Name
DisplayName:
mov dh, 14
mov dl, 12
call Gotoxy
mov edx, OFFSET vName
call WriteString
;MP3 Header
ReadMP3Header:
mov dh, 16
mov dl, 12
call Gotoxy
mov edx, OFFSET vMP3Header
call WriteString
call ReadHex
;Version
DisplayVersion:
mov ecx, eax
;AAAAAAAAAAABBCCDEEEEFFGHIIJJKLMM
and eax, 00000000000110000000000000000000b
shr eax, 19
cmp eax, 00b
jz dMpeg25
cmp eax, 01b
jz dMpegRE
cmp eax, 10b
jz dMpeg20
mov edx, offset vMpeg10
jmp DisplayString
dMpeg25:
mov edx, offset vMpeg25
jmp DisplayString
dMpegRE:
mov edx, offset vMpegRE
jmp DisplayString
dMpeg20:
mov edx, offset vMpeg20
jmp DisplayString
DisplayString:
call WriteString
;Layer
DisplayLayer:
mov eax, ecx
;AAAAAAAAAAABBCCDEEEEFFGHIIJJKLMM
and eax, 00000000000001100000000000000000b
shr eax, 17
cmp eax, 00b
jz dLayerRE
cmp eax, 01b
jz dLayerIII
cmp eax, 10b
jz dLayerII
mov edx, offset vLayerI
jmp LayerDisplay
dLayerRE:
mov edx, offset vLayerRE
jmp LayerDisplay
dLayerIII:
mov edx, offset vLayerIII
jmp LayerDisplay
dLayerII:
mov edx, offset vLayerII
jmp LayerDisplay
LayerDisplay:
call WriteString
ret
;Sampling Rating
call ReadChar
main ENDP
END main