MACRO Made Easy » MACRO Made Easy – Part V: Barkeep! How 'Bout Some Service?
MACRO Made Easy – Part V: Barkeep! How 'Bout Some Service?
Part V: Barkeep! How 'Bout Some Service?
We've already seen that run-time library routines are usually called from MACRO using the CALLS and CALLG instructions. The VMS system services are also called with these instructions, but usually only indirectly. The default macro library, STARLET.MLB, contains macros for calling each of the system services. The macros make it very easy to specify the parameters to be passed to the services, in addition to helping with the program's self-documentation.
The $ASSIGN system service assigns an I/O channel to a device. I'll use that in the following examples because it nicely illustrates several points about calling the system services.
Of the four, only two are required: the devnam (device name) and the chan (channel). The access mode and the mailbox name are optional parameters. However, unlike the run-time library routines, the optional parameters cannot simply be omitted. The system services expect all of their arguments to be passed; optional parameters such as acmode and mbxnam are "omitted" by passing a value of 0. This is true for all the system services. Some high level languages, such as C, let you omit optional parameters; the compiler will generate the code to pass 0 for all omitted parameters. In the case of MACRO, the system service macros provide defaults for optional parameters.
In both cases, acmode and mbxnam default to 0.
The Figure shows the actual definitions of all the SYS$ASSIGN macros. They were taken from STARLET.MLB, with comments that I supplied.
;  system macro library, SYS$SYSTEM:STARLET.MLB.
;  storage for the argument list.
;  Note that all parameters default to 0.
;  (ASSIGN$_DEVNAM = 4, ASSIGN$_CHAN = 8, etc.).  $OFFDEF is another macro.
;  SYS$ASSIGN as a global (external) symbol.
;  addresses onto the stack.
Programmer's Hint #1: Using the keyword method of specifying the system service parameters performs two useful functions. It helps document the program by specifying which parameter is which, and, more importantly, it shields you from any possible future changes in the parameter order.
The _G form of system service macro expands to call the service using a CALLG instruction. As I described last issue, the CALLG instruction accepts an argument list address as its first operand; the _G macros also expect the argument list address as a parameter.
The macro without an extension is normally used to build the argument list for a service called via CALLG. For example, the $ASSIGN_G macro calls the SYS$ASSIGN system service, while the $ASSIGN macro is used to create the argument list. The $ASSIGN macro (and similar macros for all the services) accepts all the same keyword parameters as the _S form. However, instead of generating instructions that push the arguments onto the stack, assembler directives are generated that build the argument list as data.
Using the CALLG form can result in significantly faster code, because the arguments no longer have to be pushed onto the stack. This should be especially evident in loops that call something like $QIOW over and over. The SYS$QIOW system service expects twelve arguments—if $QIOW_S is used in a loop, all twelve arguments get pushed onto the stack each time. If the argument list is static, or mostly static, a tremendous savings can result from using CALLG.
Programmer's Hint #2: Use the CALLG form wherever possible to make the code more efficient and legible.
Note that the use of CALLG can result in non-recursive routines. Depending on the routines being called, argument lists may point to buffers that are to receive data from the called routine. Because CALLG argument lists are static, the same buffer would be used for each recursion through the routine. If you must write recursive (or AST-reentrant) routines, you must make sure that your argument lists point to static, read-only data areas. Otherwise, you should use CALLS and allocate storage from the stack.
For large argument lists, using this form of addressing should prove to be slightly faster. The MOVAL instructions moves the address of QIOW_ARGLST into R1, while MOVZWL (MOVe Zero-extended Word to Longword) converts the channel (stored as a word) to a longword by filling the high-word with zeros (zero-extending the word).
The same rules apply to local labels in data psects as in code psects. They can only be referenced between two non-local labels or within a local block. Because the MACRO assembler is a two-pass assembler, the fact that it doesn't know about 10$ during the first pass doesn't make any difference to the final data.
Several system services expect the address of an item list. Because it is a very common data structure, let's take a brief look at how an item list is constructed.
An item list just consists of a series of item descriptors, terminated by a longword 0. The size and item code each consist of one word; the address of the item buffer can be a source or destination buffer, depending on the item code, and the return length buffer is the address of a longword which will receive the length of the data written to the destination buffer. If you don't want to specify a return length address in an item list, just specify 0 in the longword.
One of the most commonly used services that requires an item list is $GETJPI (and its synchronous form, $GETJPIW). $GETJPI (GET Job and Process Information) returns information about processes on the system. It accepts a number of parameters, one of which is the address of the item list. Each piece of information that can be returned by $GETJPI is described by an item code that begins with JPI$_. For example, the username can be returned by specifying JPI$_USERNAME and the PID can be retrieved via the code JPI$_PID. These item codes are defined in the STARLET macro $JPIDEF.
Item lists can be difficult to understand or construct when using high-level languages, but in MACRO, the item list is an almost-trivial data structure.
Which version is better is solely dependent on the programmer; the first version is clearly easier to type, but the second provides additional information about each parameter.
Now that we have the .ITEM macro, we can write another macro that will let us create the entire item list, including the terminating longword 0. While there are a number of ways such a macro could be written, my item list macro, called ITMLST, will actually invoke .ITEM to store the data. In order to do that, ITMLST must accept a variable number of groups of .ITEM parameters and invoke .ITEM for each group. The angle brackets, <>, are used to create such groups in macro calls.
The .IRP directive iteratively extracts items from a comma-separated list. The implication, then, is that ITEMS must be a list of .ITEM parameters separated by commas. But the .ITEM parameters must also be separated from each other by commas. To accomplish this, angle brackets, <>, can be used.
Because there are no more list items, the assembler drops out of the .IRP-.ENDR loop and continues expanding ITMLST. The only thing left is the directive to store the longword 0 that terminates the item list.
Note that I used the continuation character to spread the macro call over multiple lines to make it easier to read. Again, keyword usage is often a matter of taste, as it does require more typing. However, I find the results well worth the effort.
We saw last issue that the run-time library routines are called via CALLS or CALLG instructions. For efficiency, some routines can also be invoked via a second entry point using a JSB (Jump SuBroutine) instruction. The manual entry for each RTL routine will indicate whether or not the routine can be invoked with JSB. Note that the JSB interface is only available from MACRO and BLISS, because high-level languages don't provide direct support for the JSB instruction.
Additional information about the JSB interface can be found in the VMS manuals entitled Introduction to the VMS Run-Time Library and VMS RTL String Manipulation (STR$) Manual.
Virtually all of the RTL routines that provide a JSB entry point deal with dynamic strings. The Table lists all of the STR$ routines that can be invoked with a JSB. The only OTS$ and LIB$ routines that support JSBs are the OTS$ and LIB$ versions of some of the STR$ routines. The MTH$ routines also provide a number of JSB entry points.
When the JSB entry point is used, input and output parameters are passed to the routine in registers instead of through an argument list. The JSB entry point name includes a suffix that denotes the highest register that will be accessed or modified. All registers from R0 to the register indicated in the routine name can be used by the RTL routine. As the VAX Calling Standard dictates, you should always assume that R0 and R1 are modified.
For example, the routine STR$ANALYZE_SDESC, which analyzes string descriptors, has a JSB entry point named STR$ANALYZE_SDESC_R1. The R1 suffix indicates that R1 is the highest register that will be modified. Similarly the JSB entry point STR$COPY_DX_R8 will modify R0 through R8.
Parameters are passed in the same order as they are specified with the CALL interface by placing the first parameter in R0, the second in R1, and so on. The manual entry for each routine should be consulted to ensure that the parameters are passed via the appropriate mechanism (by reference or by value). In general, the parameters are passed the same way for both interfaces.
When a JSB is used to invoke STR$ANALYZE_SDESC_R1, only one parameter is passed in a register: R0 holds the address of the input descriptor. The output parameters are returned in R0 and R1, as indicated by the suffix R1. The output parameters are always returned in their respective order, starting with either R0, R1, or R2, depending on whether or not the routine returns a condition value in R0.
Whichever method is used for calling RTL routines, general addressing (G^) should always be used so that the linker and the image activator can find the routine in the shareable image.
Next issue, we'll take a closer look at the differences between the synchronous and asynchronous system services and how you can use them to your advantage. Also, now that we've covered the basics of looping and calling other routines and system services, it's time to look at some of the benefits of the powerful VAX instruction set. We'll start by taking a look at the extensive support for character manipulations and examining the best ways for moving data around.


The results highlight the importance of nitrogen in reaching yield potential and achieving adequate protein levels with low screenings (see results over page).
In addition, the trials show consistent relationships between nitrogen rate and water use efficiency (WUE).
Maximising the conversion of moisture to grain is a key goal in dryland cropping and nitrogen can help with this.
While there are many things we can learn from these trials over the years, here are a few key points to consider for this season.
The first 30 to 40 kg/ha of nitrogen (65 to 87 kg/ha of urea) provides the greatest yield gains over control.
In higher rainfall years, or where there is stored moisture, at least 60 kg/ha of nitrogen (130 kg/ha of urea) is required to maximise yield.
Early applications prior to fully tillered growth stage are essential to maximise root development and shoot density.
Taking advantage of early season rainfall events to apply nitrogen is critical. Start the program when you can.
Given low soil mineral nitrogen levels, there is no risk of haying off with 30 to 40 kg/ha of nitrogen, even in below average seasons.
Screenings tended to be lower with increased nitrogen rates in these trials.
Water use efficiencies increased with nitrogen rate. Be aware of variations in moisture availability across different soil types.
Maximising yield at >10.5% protein is a key driver to profitability.
To maximise yield, protein needs to be >10.5% or APW quality.
In the trials, applying nitrogen above the optimum rate was more profitable than applying nitrogen below the optimum nitrogen rate.
The first 30 to 40 kg/ha of nitrogen provides the greatest yield gains over the control, but in higher rainfall years, at least 60 kg/ha of nitrogen is required to maximise yield.
To maximise yield, protein needs to be more than 10.5%. In the trial crops, this generally took 70 kg/ha of nitrogen.
Screenings trended lower with increased nitrogen rates.
Using a basic water use efficiency calculation for each trial year shows the value in managing nitrogen rate to better utilise moisture.
Note: Based on non productive moisture 110 mm, GSR April-Sept and stored moisture at 30% of summer rainfall.


text:
Nosipho Dyasi
Office Management & Rhino Cafe | Cafe
Nosipho is a friendly face and can be found most of the time helping the guys in the Rhino Cafe. She was born in Queenstown in South Africa's Eastern Cape where she grew up with her two brothers and sister. When she was fifteen, she moved to Cape Town and has been here ever since. After school, she worked as a waitress at the Cape Town International Convention Centre and the Mount Nelson Hotel. She then went on to complete a Computer Course and shortly afterwards joined us at Rhino. When not working she likes to rest at home and often listens to the radio. Her favourite radio station is Umhlobo Wenene but on Sundays she shifts to Metro FM for their classic love songs mix.
A selection of Nosipho 's favourite tours
Zannon's Colours of South Africa Tour
From the vibrant Mother City and her winelands to the incredible biodiversity of the Sabi Sand Game Reserve, experience the best of cityscapes and safaris with Zannon.
Serengeti - Ngorongoro - Zanzibar
Zanzibar Archipelago
Iconic locations await travellers eager to experience East Africa's abundant beauty. From action-packed safaris to unblemished beaches, experience the best of Tanzania.
A Taste of Tanzania's Wild and Sea
Ruaha National Park
Selous Game Reserve
Zanzibar Island
A wondrous journey to the Tanzanian wilderness and views of its majestic wildlife topped off with an idyllic beach-side retreat in this best-of-both-worlds getaway.

redpajama_set_name: RedPajamaCommonCrawl


text:
Red Alerts in the Go Green Agenda: Cobalt Mines in Congo
Olivera Andonoska January 12, 2022 3 min read
Cobalt is a chemical element with the symbol Co and atomic number 27.
It is a metal used in many different industrial, commercial and military purposes, but primarily in lithium-ion batteries and the manufacture of magnetic, wear-resistant and high-strength alloys. Until 2018 most of the cobalt was used for mobile device batteries; one more recent application is rechargeable batteries for electric cars. This industry has increased its demand for cobalt five-fold, making it urgent to find new raw materials in more stable areas of the world.
It would seem that cobalt's popularity and the green agenda go hand in hand.
While cobalt is ranked as a critical mineral in some countries (USA, Japan, the Republic of Korea, The United Kingdom and EU countries), the Democratic Republic of the Congo has plenty of it and accounts for more than 50% of the world's production. However, Congo doesn't have any electric cars, even though those rechargeable battery electrodes are made of cobalt from the Congolese Copperbelt. On the other hand, Norway leads in electric vehicle (EV) adoption, made with the cobalt from Congo, of course. Ok, maybe Congolese have a lot less money than the Norwegians: (Norway's GDP per capita in 2021 is $91.500, while in Congo GDP per capita is $420), but they have some numbers far higher than Norway they can "brag" about, for example, they are 236.5 times more likely to die during childbirth.
In Norway, approximately 2.0 women per 100.000 births died during labor in 2017, while in Congo, 473.0 women died.
Congolese children are 25.8 times more likely to die during infancy.
In Norway, approximately 2.5 children die before they reach the age of one, according to the data in 2020, and in Congo, on the other hand, 64.5 children.
According to the latest human development index (HDI) ranking, Norway is still in the lead before Switzerland, Ireland and others, while Congo is at the bottom, facing a lack of access to healthcare, low incomes, thus poverty and low life expectancies. Even so, Norway cannot boast that it has cyborgs walking through its clean environment, unlike Congo. People in Congo are full of toxic metals; that is why ~3.2 million birth defect-related disabilities kill 300.000 newborns every year. The rate of congenital disabilities in this African country is estimated at 71 per 1.000 children, making the DRC rank highest regionally and among the highest in the world.
Compared to Norwegians, Congolese live 21.1 years less. The average life expectancy in Norway is 82 years (80 years for men, 84 years for women) in 2020, while in Congo, that number is 61 years (59 years for men, 63 years for women). At least they don't have obesity problems. In 2016, 23.1% of adults in Norway were overweight compared to Congo, where that number is 6.7%. Some call it hunger.
But we shouldn't worry about the miners in Congo digging cobalt without any safety measures in the dark underground tunnels so the Norwegians, for example, can buy their electric cars. According to the World Bank, they are significantly better off than other people in DRC, where three-quarters of the country's population lives on less than two dollars a day. In comparison, miners can make 2.7 – 3.3 USD per day.
One question remains open: if digging cobalt in Congo's mines was compliant with the Norwegian standards, in other words expensive, would the companies still be interested in the go green agenda?
We are not saying that life in Norway should be different, but that Congolese children deserve at least a similar life to the Norwegian and not be used as child labor.
If it interests you to "dig" a little bit more into this subject, you can watch the short documentary Toxic Cost of Going Green. Reporter Jamal Osman travels to Kolwezi, a city dependent on cobalt, where residents are employed by large multinational companies or work as artisanal miners. We meet the men who dig down in the dark, weaving, airless tunnels to extract cobalt for as little as $150 per month. But is the paycheck worth the health risks that doctors have uncovered?
Olivera Andonoska
Olivera believes that every human being has superpowers, of which empathy and self-awareness are the most important. She doesn't underestimate everyone's potential to change the world, and as a teacher, she thinks that education plays a crucial role in that change. She is passionate about writing, from children's picture books to screenplays. This year's resolution: to challenge herself more.
Tags: Cobalt Cobalt Mines Cobalt Mines in Congo Red Alerts in the Go Green Agenda
Previous: Queen's Gambit Declined- On the Gender Inequality in Chess
Next: 19-Year-Old Mother Brutally Killed in Syria by Husband and In-Laws
Women Are Tired of Defending Their Bodily Autonomy 5 min read
How Can We Best Offer Assistance to Refugees? 3 min read
How Can We Best Offer Assistance to Refugees?
Aya Ragheb March 17, 2022
Why Does the World Have Refugees? 3 min read
Why Does the World Have Refugees?
Aya Ragheb March 4, 2022
Anti-Arab Racism and Islamophobia: Two Sides of the Same Coin 4 min read
Anti-Arab Racism and Islamophobia: Two Sides of the Same Coin
Jouanna Bondakji March 1, 2022
LGBTQ and Other Muslims: A Controversial View on the Silver Screen 8 min read
LGBTQ and Other Muslims: A Controversial View on the Silver Screen
Amal Khayata Bahlawan February 21, 2022
Real Men Don't Cry: How Toxic Masculinity Hurts Us? 4 min read
Real Men Don't Cry: How Toxic Masculinity Hurts Us?
Jouanna Bondakji February 20, 2022


Senior attckmen Gage Varanakis dodges against a Corner Canyon defensemen last week.
Under Friday night lights Highland's boys lacrosse team played against their rival East in a defensive battle that came down to making the least number of mistakes. East was able to stay consistent through all four quarters and win the rivalry matchup 8-2.
In the first quarter both teams got off to slow offensive starts. Neither team could get their offenses going as it was was a defensive fight full of grit on both sides. Teams went back and forth with strong defense and some sloppy mistakes on offense. After the first quarter the game was tied at 1-1 neither team gaining an edge.
In the second quarter East started to move the ball better on offense and put some points on the board. Highland struggled to keep the ball to open up strong possessions and a few mistakes held them back from scoring. At halftime the score was 5-1 with East in the lead.
After halftime in the third, East continued to play strong defense and scored two more goals extending their lead to 7-1 with one quarter to play. The Rams continued to struggle moving the ball effectively without turning it over which made it difficult to create scoring plays.
By the fourth quarter the Rams continued to fight back and start for a comeback. In the first few minutes of the quarter Senior Holden Knight scored a much needed goal to light a spark for the team. The Rams defense fought their hardest only allowing one more goal in the fourth but unfortunately the clock had run out with East taking the game 8-2.
"We need to work on holding the ball on offense and on defense we need to work on not ball watching and sliding body", Sophomore goalie Lincoln Robison said.
The Rams will look to bounce back this week as they will face Copper Hills on Friday at Copper Hills. They are at a mid point in the season will 8 games remaining in the regular season and look to turn things around against Copper Hills and finish the season strong.


text:
LaGrange man looking forward to his first Christmas after spending 40 years wrongfully imprisoned
by: Amanda Peralta
LaGRANGE, Ga. (WRBL) – Terry Lamar Talley is looking forward to his first Christmas after spending 40 years wrongfully imprisoned for crimes he did not commit. He has spend the last 10 months getting to know his family and reconnecting with loved ones.
"My life is coming together like it's supposed to be. I always think about what I could have been if I hadn't been locked up whatsoever, I still think about that a lot. I probably wouldn't be here, I'd be someplace else enjoying myself," said Talley.
'Nobody is trying to help'; Columbus woman living in home that code enforcement wants to condemn
Talley was imprisoned in 1981 on three counts of rape and three counts of attempted rape and faced multiple life sentences. With the help of the Georgia Innocence Project he was released from Dooly State Prison on Feb. 23, 2021 and was reunited with his family.
He is looking forward to spending Christmas at home for the first time in a long time and watching football.
Talley said the past 10 months have been a learning process for him as he's re-acclimating to society once again. He has had to learn to pay bills, adjust to family life and live with Chronic Obstructive Pulmonary Disease (COPD) which limits the amount of physical activity he can do.
Wreaths Across America lay over 6,000 wreaths for soldiers at Fort Mitchell National Cemetery
He was first diagnosed with COPD in 2019 while he was still incarcerated but said it has significantly developed since he was released in February limiting his ability to find a job or do exercise.
Joann Talley, Terry's mother, said she is happy to have her son home but worries about his acclimation to society.
"For this new year, I hope things will be much better. I'm hoping that he will get out and go places and be around people that he's been knowing before he went off to prison. Get back in communication with them, visit them and they visit him. I hope everything works out good for the following year," said Joann Talley.
Salvation Army volunteer returns for another day of giving, continuing a 23-year tradition
She hopes Terry will find a job in the new year that he can manage with his COPD.
Terry Talley said his new year resolutions are to work on being healthier and to continue acclimating to society.


text:
Aaron Regev, the sales manager of Total Home Protection, one of the fastest home warranty companies in the United States, recently sat down for an interview with Tricitydaily.com, an Internet news entity focused on keeping the news simple and understandable. In the interview, Regev discussed leadership and the importance of having purpose-driven company values.
Regev began the interview by discussing how the pandemic has affected his life. While the effect on his personal life has been just as intense as the rest of the world has experienced, the effect on the company was mostly positive. As an online company, Total Home Protection was already positioned to continue online business during shutdowns. They were able to show positive growth and help customers who were worried about expenses, affordability, and things in the home breaking down.
How Leadership is Critical
Regev said that his leadership style was derived from the way he was raised. His parents, immigrants from the Middle East, taught him tough love from a young age, but also instilled in him the values of hard work and perseverance. He described his leadership style as tough but fair.
"I'm a firm believer that, sometimes, people need to hear what they don't want to hear — and sometimes, that means that I have to be a little stern to make sure that the message comes across in the right way," Regev said.
He stressed the importance of respecting employees to earn their respect. He lets his team know when they have done something badly or incorrectly. He makes sure to let his displeasure show when explaining what went wrong. However, he states that his team loves and respects him, and he loves and respects them back.
Regev also discussed delegation. He said that leaders should not be afraid to roll their sleeves up and get their hands dirty. He knows that anything his managers can do, he can do as well. He strives to work with his team instead of sitting in silence and passing down directions to guide the team through daily responsibilities.
Regev also stressed the importance of an open-door policy. He makes sure that his office is always open and regularly reminds his team they can interrupt him at any time. He is available to help if they are struggling.
Purpose-Driven Company Values
At Total Home Protection, values are the most importan. Regev said in the home warranty business, you have to have strong values. The value held by Total Home Protection is to assist customers 100 percent of the time. The company has the vision of reimagining the home warranty industry, making life easier for their customers. Regev's personal mission is to instill the company values in his team so they can support customers and help them in every way possible.
The Worst Advice
Regev said that the worst advice he has received came from an older mentor. His advice was, "screw the next guy." Regev said the strategy may have worked for his mentor, but it did not work for him. He believes the tactic will cause trouble and so never listened to the advice. He recommended the same for readers.
"Instead of worrying about other people, concentrate on yourself. Build yourself up because breaking people down isn't going to actually help you get any better," Regev said.
The Best Advice
Regev offered some good advice to readers as well. He suggested that the best way to get on the path to success is through education. He recommended learning the industry you want to have a career in as well as the business world in general. He stressed that many things can't be learned from classes or books, so people should learn as much as they can from the beginning to achieve success in the real world with real people to become great entrepreneurs.
Regev said, "It can be a bit scary to branch out and learn things on your own, but get it done anyway because it is the entrepreneurs that start off as the most indispensable that achieve the most success."
Tags: Aaron Regevaaron regev faqAaron Regev Sales ManagerSales Manager of Total Home Protection