merthsoft wrote:
Step 1: Open wikiti
Step 2: Open up the bcalls by name list: http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name
Step 3: Use your seeing orbs and squishy think thing to maybe take five seconds to find the bcall that gets you the data you want.
Step 4: Oh look, there're clock bcalls: http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name:Clock


I want the Date in the lower left in this format:
MM\DD\YY

I want the Time in the lower right in this format:
HH:MM (12-hour mode)

How do I do this?
-_-;

You use the freakin' bcalls in that wiki. One gives you month day and year, and one gives your hours and minutes.
Ephraim B wrote:
Edit: Oops, you gave me the CSE b_call(, i'm coding for the ti 84 plus. Trying the ti 84 plus b_call(.
I gave you http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:47E0 .

For the last time, please learn to read and use the documentation and tutorials available. We're essentially writing your program for you.
Ephraim B wrote:
merthsoft wrote:
Step 1: Open wikiti
Step 2: Open up the bcalls by name list: http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name
Step 3: Use your seeing orbs and squishy think thing to maybe take five seconds to find the bcall that gets you the data you want.
Step 4: Oh look, there're clock bcalls: http://wikiti.brandonw.net/index.php?title=Category:83Plus:BCALLs:By_Name:Clock


I want the Date in the lower left in this format:
MM\DD\YY

I want the Time in the lower right in this format:
HH:MM (12-hour mode)

How do I do this?


Where in this page:
http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:514F
and this page:
http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:515E
does it say how to set the position on the screen?

I need step by step help with the b_calls. I'm having a hard time copying from the buffer to the screen.
Oh my goodness, the second link you provided even shows you how to use it! It uses the _vputs bcall, which is controlled by pencol and penrow. Just change these values... Please also read the manual. It covers the FPS and buffers.
How do I display, increase, and decrease a number in the format 0.00 (2 decimal place number) in ASM?

I don't want 8.8 fixed number. I want a number with 2 decimal places.
What could you possibly mean? 8.8 just means that 1 byte is used for both the fraction and whole number. It is a an old style to represent fractions for sure, but it does an okay job in z80.

I would suggest that you completely avoid the whole decimal issue for now, and simply store it as a whole number, but just change the location of the decimal point.

For example:

Code:
   ld hl,500         ;Set initial value
   dec hl            ; HL now holds 499
   ld de,$0000
   ld (pencol),de
DispHL:
   bcall _setxxxxop2      ; Display Register HL
   bcall _op2toop1
   ld a,$05
   bcall _dispop1a


That's for displaying the number in base 10, and hopefully shows you how to change it. Now, all you have to do is write the code to display the decimal point at a certain spot -- I would recommend that you just make it a point and display it, rather than a character. Hopefully this helps!

(I wish the spacing in code tags worked better with tabs. Cool )


EDIT: And here are some links that will provide everything that you should start with and know about to some degree before anything else:

IMPORTANT:
http://tutorials.eeems.ca/ASMin28Days/lesson/toc.html
BEST:
http://education.ti.com/~/media/672891A1E98349CAB91C11B4928C253C
How do I add .01 in ASM the easiest way.
Ephraim B wrote:
How do I add .01 in ASM the easiest way.
Did you read anything in the post above yours?
I would love to know the simplest way to add .01 in ASM without scrolling through documentation.

Any b_calls?
Ephraim B wrote:
I would love to know the simplest way to add .01 in ASM without scrolling through documentation.

Any b_calls?
Let me repeat my question. Did you read the post directly above yours? Why do you want us to do the "scrolling through documentation" for you?
Ephraim B wrote:
... without scrolling through documentation.


You just told us everything we needed to know.

We have given you the links.

We have given you the documentation.

We are not going to just program things for you. Go figure it out. Go read the tutorials. Go read the documentation.

This is getting ridiculous. Neutral
MateoConLechuga wrote:
What could you possibly mean? 8.8 just means that 1 byte is used for both the fraction and whole number. It is a an old style to represent fractions for sure, but it does an okay job in z80.

I'm would suggest that you completely avoid the whole decimal issue for now, and simply store it as a whole number, but just change the location of the decimal point.

For example:

Code:
   ld hl,500         ;Set initial value
   dec hl            ; HL now holds 499
   ld de,$0000
   ld (pencol),de
DispHL:
   bcall _setxxxxop2      ; Display Register HL
   bcall _op2toop1
   ld a,$05
   bcall _dispop1a


That's for displaying the number in base 10, and hopefully shows you how to change it. Now, all you have to do is write the code to display the decimal point at a certain spot -- I would recommend that you just make it a point and display it, rather than a character. Hopefully this helps!

(I wish the spacing in code tags worked better with tabs. Cool )


EDIT: And here are some links that will provide everything that you should start with and know about to some degree before anything else:

IMPORTANT:
http://tutorials.eeems.ca/ASMin28Days/lesson/toc.html
BEST:
http://education.ti.com/~/media/672891A1E98349CAB91C11B4928C253C


B_call(_setxxxxop2)

What should I write for xxxx?

What I'm trying to do is do user input with a decimal number with 2 places. Pressing the up arrow would increase by 1, down would decrease by 1. Right arrow key to change what number place to increase or decrease.
The bcall is literally called _setxxxxop2, as you would know if you had read the documentation.
Please, read my post one more time. Don't worry about decimals just yet. They can be strange at first. Just display a point in between the decimal and the whole number, sort of like a pseudo-decimal number. This will make math many times easier if that is what you are planning, and you will be able to understand what is happening better. Look at the BEST link for bcalls, but remember, bcalls are just locations that the program jumps too. You can pretty much create your own versions as well.

EDIT: If you want to move in between each place value, just multiply by 10 each time you move left. For example, to change 4.99 to 5.09, I could add 10 to the number. From 5.09 to 4.09, I could subtract 100.

By the way, before it might happen, a register cannot hold a decimal.
I suggest that you read http://catb.org/esr/faqs/smart-questions.html . It is an excellent guide to asking questions, and I feel everyone here, especially you, would be more productive if you read and understood it. It is really a lot easier than learning z80 assembly.
I looked all over the web and Cemetech and it's only giving me the outputs for b_call(_getDate).

Outputs:
OP1=Day of Month
FPST=Day of Month
FPS1=Month
FPS2=Year

I want to do the MM\DD\YY format.
How do I display the outputs above?
I tried every method and I couldn't get it to display.
I want to display it in small font in the lower left of the screen.

How do I do this?

This is the section of code that i'm having trouble trying to display the date:

Code:
;----Taskbar Date----

   b_call($514F)

   LD   HL,$9842

   LD   A,56
   LD   (penRow),A
   LD   A,0
   LD   (penCol),A

   b_call(_DispHL)

   LD   A,56
   LD   (penRow),A
   LD   A,5
   LD   (penCol),A

   LD   A,'/'
   b_call(_VPutMap)

   LD   HL,$9842

   LD   A,56
   LD   (penRow),A
   LD   A,10
   LD   (penCol),A

   b_call(_VPutS)

   LD   A,56
   LD   (penRow),A
   LD   A,15
   LD   (penCol),A

   LD   A,'/'
   b_call(_VPutMap)

   LD   HL,$9842

   LD   A,56
   LD   (penRow),A
   LD   A,20
   LD   (penCol),A

   b_call(_VPutS)


This is the output:

Okay, before I answer, let me say one thing: Everything you need is in the two links I gave you. Please read them already!

So, if you look at the documentation for the _DispHL bcall, you will notice that it displays in large font. Use the routine that I gave you, please: _dispop1a. ---Make sure you set the small font flag!

Next, take a look at this awesome list of bcalls that was in the documentation:


Code:
FPS = Floating Point Stack
FPST = Floating Point Stack Top. This is the last nine bytes of the FPS.
FPS1 = Floating Point Stack minus 1 entry. This is the second to last nine bytes of the
FPS. Each previous nine bytes would continue this scheme FPS2, FPS3 ... FPSn.


Mateo is currently pondering something...
Mateo - Finished pondering and decided to just write the program. See below.
I want a way to display the Date in DD\MM\YY instead of DD\MM\YYYY because DD\MM\YYYY doesn't fit in the space I made for the Date:


Also, when I select 0 in the User Input:


It gives me an Err:Overflow message:


When I select any other number in User Input (Example:1):


It displays the Results screen like it's supposed to do:


Why am I getting the Err:OverFlow message when I select 0 in User Input?
How do I fix this?

And how do I change the date format from DD\MM\YYYY to DD\MM\YY?

Edit: Here's the code for it:

Code:
DollarsToGallionsResults:      ; label DollarsToGallionsResults

   PUSH   BC         ; Save Register BC for later

   b_call(_ClrLCDFull)      ; Clears the screen

   LD   HL,txtItem1ResultHeader ; load label txtItem1ResultHeader
               ; into Register HL

   CALL   dispHeader      ; goto dispHeader routine

   LD   A,15         ; 15->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,25         ; 25->Register A
   LD   (penCol),A      ; Register HL->(penCol)

   LD   HL,txtSelect1UserInputDS ; load label txtSelect1UserInputDS
                ; into Register HL
   b_call(_VPutS)         ; Display small text

   LD   A,15         ; 15->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,32         ; 32->Register A
   LD   (penCol),A      ; Register A->(penCol)

   POP   BC         ; Recalls the value of Register BC

   LD   H,0         ; 0->Register H
   LD   L,B         ; Register B->Register L

   b_call(_SetXXXXOP2)      ; Sets OP2 equal to a floating-point
; integer between 0 and 65535.
   b_call(_OP2ToOP1)      ; Copy value of OP2 to OP1
   b_call(_DispOP1A)      ; Displays a floating-point number
; using either small variable width or large 5x7 font. The value is rounded to
; the current “fix” setting (on the mode screen) before it is displayed.

   LD   A,15         ; 15->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,47         ; 47->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   HL,txtIsWorth      ; load label txtIsWorth
               ; into Register HL
   b_call(_VPutS)         ; Display small text

   LD   A,23         ; 23->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,30         ; 30->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   HL,txtGallion      ; load label txtGallion
               ; into Register HL
   b_call(_VPutS)         ; Display small text

   LD   A,23         ; 23->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,55         ; 55->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   A,','         ; load , into Register A
   b_call(_VPutMap)      ; Display small text

   LD   A,30         ; 30->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,30         ; 30->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   HL,txtSickle      ; load label txtSickle
               ; into Register HL
   b_call(_VPutS)         ; Display small text

   LD   A,30         ; 30->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,51         ; 51->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   A,','         ; load , into Register A
   b_call(_VPutMap)      ; Display small text

   LD   A,30         ; 30->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,55         ; 55->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   HL,txtAnd      ; load label txtAnd
               ; into Register HL
   b_call(_VPutS)

   LD   A,37         ; 37->Register A
   LD   (penRow),A      ; Register A->(penRow)
   LD   A,30         ; 30->Register A
   LD   (penCol),A      ; Register A->(penCol)

   LD   HL,txtKnut      ; load label txtKnut
               ; into Register HL
   b_call(_VPutS)         ; Display small text

   LD   B,0         ; X1 position
   LD   C,8         ; Y1 position from bottom
   LD   D,95         ; X2 position
   LD   E,8         ; Y2 position from bottom
   LD   H,1         ; 1=Normal line

   b_call(_ILine)         ; Display the line

Code:
; (C) Matt Waltz
; Displays the date in DD/MM/YY -- Is customizable

.nolist

#define   bcall(xxxx)   rst 28h \ .dw xxxx
.addinstr   BCALL * EF   3 NOP 1

;<--- BCALL Equates --->
_ClearGraphBuf   =$4BD0
_CopyGraphBuf   =$486A
_dispop1a   =$4BF7
_op2toop1   =$4156
_setxxop1   =$478C
_setxxxxop2   =$4792
_ForceFullScreen=$508F
_VPutS      =$4561
_ConvOP1   =$4AEF
_GetDate   =$514F
_CpyTo1FPS1   =$4432
_CpyTo1FPS2   =$443B
_CpyTo1FPST   =$4423

;<--- Memory Equates --->
pencol      =$86D7

.list

.org   $9D93
.db   $BB,$6D

ProgramStart:
   bcall _ForceFullScreen
   bcall _ClearGraphBuf
   set 7,(iy+20)
   res 2,(iy+50)
   
   ld de,1               ; Set initial coordinates
   ld (pencol),de
   
   bcall _GetDate
   ld a,$02
   bcall _dispop1a
   call PutSpace   
   bcall _CpyTo1FPS1
   ld a,$02
   bcall _dispop1a
   call PutSpace
   bcall _CpyTo1FPS2
   bcall _ConvOP1            ; DE now holds the year
   ld hl,1900            ; Minimum date held
   ex de,hl            ; Swap Hl,DE
   xor a               ; Clear Carry
   sbc hl,de            ; Subtract; L should be the only one holding anything
   ld a,l               ; This makes it easier to compare
   cp 110
   jr nc,NoExtraZero
   cp 100
   jr c,NoExtraZero
   ld hl,Zero
   bcall _VputS
NoExtraZero:
   bcall _setxxop1
   ld a,$02
   bcall _dispop1a
   bcall _CopyGraphBuf
   ret

PutSpace:
   ld de,(pencol)
   dec de
   dec de
   ld (pencol),de
   ld hl,Slash
   bcall _VputS
   ret
   
Slash:
   .db "/",0
Zero:                  ; Probably could have used a different display routine, but hey, it's two extra bytes...
   .db "0",0


That should in theory do what you want, but you are going to have to be more specific for your second question. Some code, perhaps? Thanks!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4 ... 9, 10, 11  Next
» View previous topic :: View next topic  
Page 3 of 11
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement